Basically, this is what I am trying to do:
StatusChangedInKanban. And I tried the suggestion mentioned there.
I have created webhook to fire Jenkins using "jira-trigger-webhook-receiver" plugin.
The following JQL works(filters the event to kick the build in Jenkins):
project = MyProject AND type in (Bug, ...).
But NOT the following(always kicks build in Jenkins, as if "All Issues"):
status changed FROM "In Progress" TO Done. (I tried different combination of it). Seems like it doesn't even know what "changed from/to" is.
However it shows in the operator drop-down when I type in the "Issue related events" for JQL.
Looks like I am missing some configuration somewhere.
And I tried that workflow method mentioned in the above link as well. Didn't work.
What am I doing wrong?
0
votes
1 Answers
0
votes
When you do a STATUS CHANGED FROM or STATUS CHANGED TO query in JQL, it looks at the entire history of the issue, not the most recent change. Therefore, you're getting everything that ever changed from "in progress" to "done".
Since you're dependent on the webhook, you can trust that the automation kicks in every X minutes or days. Thus, your query should probably look like this:
project = MyProject AND type in (Bug, X, Y)
AND status changed FROM "In Progress" TO Done AFTER -1d
AND status = Done
Line by line, this is what you're telling JIRA:
For Bug, X, and Y issues in MyProject
Find everything that changed from In-Progress to Done in the past day
(you can adjust the -1d to match your automation frequency, like -5m for the past 5 minutes)
And is currently Done
(because if you have a subsequent status like Closed then you don't want it to build)
jira-trigger-plugin
's Changelog matcher option? You can add aJIRA Field Matcher
for Status field, hence doing the filtering in Jenkins instead of JIRA. Check the plugin's README / help for more information. – ceilfors