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 votes
Accepted answer
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
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

455 views 8 27
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