How to create a Webhook to trigger a JIRA issue status transition?

Chris Fouts May 19, 2020

I've read the docs on Webhooks, but it seems like what I want to do - transition.a JIRA issue status from A to B - will require some API calls. Any done this before, and willing to share?

So when a Bitbucket pull request is merged, I want to fire up a web hook that will transition the JIRA ticket status that the PR addressed from "In-Progress" to "Testing" for example. I know how to create the web hook in Bitbucket, just don't know how to perform the action that I want. The ticket is part of the source branch name in the pull request, for example, bugfix/PROJ-1234-fix-login-bug, where PROJ-1234 is the JIRA ticket number. Thanks

2 answers

0 votes
Henrik Gerdtsson October 14, 2020

Hello @Chris Fouts,

Any luck with this yet. I am trying to do the same with the PR Approved. I am able to create the WebHook but I am struggling with the URL for transitioning the issue.

Your specific problem should be handled by a Workflow Trigger. I tried it and did not have any references to the issue in the commit message. The branch and the PR was created from the issue in Jira. That might have helped. I will do some more testing.

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 16, 2020

Hi @Henrik Gerdtsson@Chris Fouts

please look at Automation for Jira application, which is now integrated in Jira Cloud.

There's possibility to do some action (e. g. transition the issue) based on the incoming webhook.

Chris Fouts October 16, 2020

thanks, will take a look.

Henrik Gerdtsson October 23, 2020

@Chris Fouts It seems like as long as the Jira issue key is present in the branch name Jira will pick it up and display the information in the issue. There are a number of triggers in Jira related to actions in Bitbucket. I would say all but Approved, which is the one I need.

I am on server, it might be different in Cloud.

0 votes
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 19, 2020

Hi @Chris Fouts ,

would you please provide me more information, what you are trying to do?

Am I getting right, that you have Jira cloud and you want to transition some issue from status A to B?

Based on what action this should be done? It is somehow connected to Bitbucket (it is mentioned in tags)? For example after some changes are commited or pull request is merged?

Thank you.

Chris Fouts May 19, 2020

@Hana Kučerová  I updated my original post. Thanks

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 20, 2020

@Chris Fouts Thank you for the clarification.

I would recommend you to use triggers instead of webhooks. Please look at the article and let me know, if the solution is suitable for your use case. This functionality is native and designed for such situations. Thank you.

Chris Fouts May 20, 2020

@Hana Kučerová 

To make triggers work, article says "Ensure that the pull request includes commits that reference the issue (in their commit messages)."

This doesn't always happen for us, and though it's a good practice and I've enforced this before in a different company, I don't want to require it in our current workflow.

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 31, 2020

Hi @Chris Fouts

sorry for the late answer.

I tried to find any other way, how to do it, but I didn't succeed. The only possibility I see is to develop custom application for Jira cloud.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events