Jira Trigger, status changed trigger

I need to listen for an issue in jira, when status is changed from x to y then execute a jenkins build. The jenkins node is configured to build but the jira trigger does not seem to support status changes? or am I missing sth?

Yeah this is slightly tricky because a workflow change isn’t considered an issue update so won’t fire a regular Jira webhook :frowning:. To achieve this you need create a webhook and update your workflow transitions, something like this:

  1. Define a webhook in Jira with some or no filters
  2. Edit your specific Workflow/Transition
  3. Add a post function to call the webhook you defined in step 1

See Adding a webhook as a post function to a workflow.

You could try to use the same webhook as your Jira trigger uses, but it may change and get added/removed. Instead what I do is manually create a webook in Jira and use an n8n webhook node, then I use the function node to format the event in the same way the Jira trigger does:

@pemontto thank you for answering!

Changing jira issue status triggers the jira trigger node when the trigger is set to ‘issue update’. But I do not need any update to trigger a build, just the status change.

I am totally new to n8n, so I will have to strive real hard to understand your comment and imitate it, if you have any more resources on how I can do this please help me, that would be very helpful.

Thanks again.

If that works for you then great! You could either put a JQL filter to say status = "Done" for example. Otherwise when using the webhooks from workflow transitions you’ll get an object like this you can filter on with an n8n If node ({{ $json.transition.to_status }}):

  "transition": {
    "workflowId": 123,
    "workflowName": "AT: My Dev Workflow",
    "transitionId": 5,
    "transitionName": "Accepted",
    "from_status": "Testing",
    "to_status": "Done"

@pemontto thanks again for answering.

Unfortunately option 1 means, the trigger will be issue update then the JQL contains status=Done, which means if the status changes to Done the jenkins build is triggered, but if someone comments afterwards or does any kind of update (other than status change from Done) then the jenkins build will be triggered as well, which is not the behavior I want.

Will give the long way a try, thanks a lot!