Scenario is :
Git -> JIRA -> Jenkins
A commit in Git, must change an issue status in JIRA, which in turn, should trigger a build for a job in Jenkins.
Method Tried :
Now, when I do a Git commit, status of Jira issue changes from InReview to InProgress and an Approve button appears. When I check in Jenkins, a build is triggered because of this issue change. Again I'll go back to JIRA, hit the Approve button, Issue status changes from InProgress to Done and this too triggers a build in Jenkins.
My requirement is that the Jenkins build should happen only on InProgress to Done status change. I am not able to point out the reason that why the InReview to InProgress transition triggers a Jenkins build.
Any pointers on this would be of great help. Thanks in advance.
After a lot of hit and trials, finally JQL did the trick for me. I edited the WebHook as follows:
In the Events (Issue related events) section, which says (Events for issues and worklogs. You can specify a JQL query to send only events triggered by matching issues.), I entered:
issuekey = "Issue-ID" AND status = "In Review"
"Issue-ID" mentioned in above line of code is for reference. In actual, its a 3 lettered word followed by the issue number, like : ABC-1
This will trigger the action(webhook) for a transition from a particular status. The moral of the story is: All transitions which source from "this value"
in JQL query status="this value"
, will fire the webhook.
Edit 1: To make the webhook more transition specific, so that it fires for one and only one transition, we can use the JQL as:
status CHANGED FROM "In Progress" TO "Open"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.