Can I send a webhook to JIRA with Automation for JIRA?

Andreas Knecht Community Champion Sep 19, 2016

I would like to write a simple script that sends a HTTP POST with some extra data (like a version I'm releasing) to JIRA and get JIRA to update some issues as a result of this. Is this possible with Automation for JIRA?

1 answer

1 accepted

0 vote
Andreas Knecht Community Champion Sep 19, 2016

One of the many rule components Automation for JIRA offers is the "Incoming webhook trigger":

Project automation - Code Barrel JIRA 2016-09-20 14-01-17.png

An incoming webhook provides a unique URL that anyone can send a HTTP POST to.  No extra authentication is required.  In case the URL ever gets sent to someone that shouldn't have it, it's trivial to generate a new URL, or you can simple disable the automation rule to stop the wrong people from executing your rule.

When you configure an incoming webhook, you can set it up to run a JQL search to find issues, or they can also be provided in the POST body.  The trigger provides a detailed example using curl on how to do this.

In the example above, we search for issues in a "Waiting for Deployment" status.

We can then access additional data that was sent in the HTTP POST body in any field that supports smart-values using the webhookData object.  For example you could use this CURL command to POST a 'releaseVersion' for the trigger above:

curl -X POST -H 'Content-type: application/json' \
 --data '{"data": {"releaseVersion":"5.3.2"}}' \
 https://automation.codebarrel.io/pro/hooks/9b49ead1assshhsecretc2d

This would then add a comment with "Issue released as 5.3.2" to any issue matching the JQL and set their status to "Done".

Incoming webhooks are incredibly useful when you're writing a quick script and want to interact with JIRA and perform some complex operations on a set of issues.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published yesterday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

60 views 0 3
Read article

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