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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Marketplace Apps

Three tips for boosting your board's efficiency with Story Maps

Trello is one of the most effective tools for driving your sprints. It's customizable for every Agile team and product owners and Scrum masters (SM) love it. However, Agile teams often struggle with:...

818 views 2 9
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