How to invoke a webhook when a JIRA event is fired? Edited

I am new to Atlassian programming and I want to invoke an external application via REST when an event is fired in JIRA, for instance when the priority of an issue is changed. (An event is fired when I change the priority in a JIRA issue, isn't it?)
I have registered the URL of a SpringBoot application as a webhook in JIRA so that this springBoot app shall be informed via a REST call that something happened in a JIRA project.

Did I understand webhooks correctly that I can use them this way?

How can I achieve that the event gets to the SpringBoot app/webhook?

Is there a way to test that an event is really fired from wihtin JIRA? How can I test this?

 

3 answers

This widget could not be displayed.
Josh Steckler Community Champion Dec 13, 2017

Hi,

In the "priority field changed" example, the way to do this is set up the webhook to fire on issue updates, then write code in your application that focuses only on changes to the priority field. 

You can set up additional logging for webhooks using these instructions to see if they're firing:

https://confluence.atlassian.com/jirakb/how-to-collect-data-for-atlassian-support-for-troubleshooting-jira-webhooks-397083035.html

Also https://requestb.in/ is your friend when troubleshooting webhooks.

This widget could not be displayed.

Hi Josh.

Thank you for this hint. I set up a requestb.in and then I made a change to a JIRA issue. The callback defined in the webhook was reached with a filled request body (JSON) and these headers: 

HEADERS

Total-Route-Time: 0

Connect-Time: 0

X-Request-Id: 4c4396cc-e69e-49d1-815c-47e6eac0dfa9

Via: 1.1 localhost (Apache-HttpClient/4.4.1 (cache)), 1.1 vegur

Host: requestb.in

Connection: close

Content-Type: application/json; charset=UTF-8

User-Agent: Atlassian HttpClient 0.23.3 / JIRA-7.6.1 (76002) / Default

Cf-Visitor: {"scheme":"https"}

Accept: */*

Accept-Encoding: gzip

Cf-Connecting-Ip: 84.175.85.213

Cf-Ray: 3cd11a95cb812702-FRA

Content-Length: 1369

Cf-Ipcountry: DE

 

My SpringBoot app's method defined in the webhook now is called...but unfortunately only when I edit a comment. Not, when creating a new issue or reassigning the issue to another person, .. What do I have to do here?

This widget could not be displayed.
Josh Steckler Community Champion Dec 15, 2017

In your Webhook configuration, you have issue-updated checked?

Untitled.png

I tried this in the meantime because I didn't had any else idea. ;-)
The checkboxes weren't activated because I thought that when "All events" is used I don't have to check the checkboxes. 

However, Josh, you were right! I didn't checked them...and that was the problem.

Thank you, Josh! :-)) 

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

215 views 3 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you