How can I update an issue status in JIRA via Jenkins? - jenkins

I am trying to connect JIRA via Jenkins and updating the JIRA Issue status once my Jenkins Job is triggered and successfully executed or failed . I am looking forward to use Jenkins POST Build Actions. Also before that I am also facing an validating credential issue .
I have tried using JIRA Plugin , but I dont see and JIRA Issue Updater field in my Jenkins Job created .
I expect
A. To connect and Validate JIRA Plugin
B. Update my ticket status in JIRA post JOB execution

If you are using a Freestyle Job there is a post action called JIRA: Update relevant Issue
If you are using Jenkinsfiles you should look at the documentation here.

Related

Github not triggering job when pull request is created to branch

I need to run a jenkins job when PR is created to my staging branch in github. The jenkins will run some test cases and return the results to github and after that only we can merge the PR to the staging branch.
I'm using GitHub pull request builder plugin in jenkins. But my job in jenkins is not getting triggered when PR is created. The webhook from github is show 200 status and its working to buid a jenkins job for github push.
I followed https://medium.com/#mreigen/integrate-jenkins-builds-into-github-pull-requests-33bc053d6210 steps.
Can anybody help me with This!
Check the Jenkins logs first.
For example, jenkinsci/ghprb-plugin issue 286 mentioned:
It looks like GitHub is sending the wrong kind of events.
The plugin only accepts pull_request and issue_comment events.
GitHub is sending a push event, so I am not sure but you might have configured the webhook using a different plugin?
Check your master config and make sure you are only telling the job triggers to use webhooks. Also, make sure you have checked the box in each job you want that says to build using webhooks.
Issue 603 involved the option "Use github hooks for build triggering", but mention an Hook URL issue.

Configure JIRA Trigger Plugin for Jenkins multi branch pipeline

I have Jenkins Mutibranch pipeline. I want to integrate my Jira with one of multibranch project. I have installed the JIRA Trigger Plugin and configured Webhook in Jira. however, when I checked in my Jenkins job it does not show me the B***uild when an issue is updated in JIRA*** but it shows when I go to View Configuration in the particular branch. it allows me to select the Build when an issue is updated in JIRA but there is no option to save the changes. I know this might be a reason the option is view only. but how can I configure this?
Is anyone configured JIRA Trigger Plugin with Jenkins mutibranch project where using Jenkinsfile? and what is the correct way of integrating this?
Should I do some coding in the Jenkins file to get this done?

Need to run a Jenkins job that was triggered after verifying the issue status on Jira

I'm trying to run a Jenkins job after I verify if the status of an Jira issue is 'Resolved' or 'Verify'. I do not want Jira to automatically trigger the job once the status is changed. I have tried using the Jira and Jira-ext plugin for Jenkins but this doesn't solve my problem. I also tried using the Conditional Step and for the job which doesn't really solve the problem. I can use the REST API's to get the status of the issue but verifying the value of the json returned and then running the job is where I'm facing the problem.

Create a branch with Jenkins with the Jira Issue Key

I'm building a Continous Integration environment with Jira, Jenkins and GitLab. One of the things I need is that every time an issue is created in Jira, a branch is created in Gitlab, with the same name as the issue of Jira, using a job by Jenkins.
Using the Jira trigger Plugin for Jenkins I get that every time an issue is created, the job is launched to create the branch, but what I can not do is read the name of the issue from the jira trigger to name the gitlab branch. Do you know what I can do?
I solved it using the JIRA_ISSUE_KEY variable that it's sent to Jenkins.

JIRA issue on jenkins job failure

I want to integrate Jenkins with jira so that, as soon as a build fails an issue is created in jira. I have already tried jira create issue in jenkins but its not creating any issue
Look at this question: Execute Shell Script after post build in Jenkins
The accepted answer by #Daniel Magnussen refers to http://wiki.hudson-ci.org/display/HUDSON/Post+build+task This is what you need as well
When the build fails, just send a curl request to jira's rest api to create a new issue. Here is some info on how to create the issue with curl:
https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-create-issue

Resources