Skip to main content

How to use webhooks to create issues for threats in Jira

This guide will walk you through all the steps you need to configure webhooks so that any new threats detected, create an issue in Jira

Daniel Sampson avatar
Written by Daniel Sampson
Updated over a week ago

Create a new Jira rule with an incoming webhook trigger

  1. Open the Automation rule builder in Jira Cloud

  2. Go to the Settings cog in the top right and select System under the Jira Settings heading.

  3. From the left-hand menu, select Global automation under the Automation heading.

  4. You should see a list of any rules you have already created. Click Create rule in the top right.

  5. In the “Add a trigger” card on the right, search for “incoming webhook” and click on the result.

  6. Click Add component in the rule builder UI or click Next in the Incoming webhook card on the right.

  7. Select Then: Add an action.

  8. In the Add an action card on the right, search for “create issue” and click on the result.

  9. In the Create issue card, configure which project you want to create the issue in and the fields you want to populate. The data sent by Defense.com will be stored in the {{webhookData}} smart value. You can use the smart value to populate your Jira issue, for example.

    1. Jira issue summary - {{webhookData.title}}

    2. Jira issue description - Risk: {{webhookData.risk}} Type: {{webhookData.type}} Threat Link: {{webhookData.url}}

    3. {{webhookData.description}}

  10. Click either Turn on rule or choose Save rule without enabling from the button drop down in the top right Note: remember to enable the rule later if you choose the latter.

  11. Name the rule, and who can edit it, then save it.

  12. In the rule builder UI click on the When: Incoming Webhook card.

  13. In the Incoming Webhook card that appears, select No issues from the webhook under the Work item criteria heading.

  14. Now copy the Webhook URL and Secret.

Jira incoming webhooks use a custom header instead of the standard basic auth to send a secret for the webhook. This is incompatible with lots of third parties who use the standard basic auth and resulted in a number of Jira community threads when it was rolled out. Fortunately, Jira was persuaded to create a workaround; you can add the secret to the end of the webhook URL Jira generates, for example, https://WEBHOOK_URL/SECRET .

Create webhook trigger in my.defense.com

  1. Login to my.defense.com as a Company admin or Tech user.

  2. Click on your Profile in the top right and select Account.

  3. Click on the Webhooks tab and then click Add Webhook.

  4. Set a name and description, then paste your Jira incoming webhook URL (with the secret on the end) into the Endpoint URL field.

  5. Under Event Triggers check Create for Threat. Note, this will trigger when a new threat is first created, but not every time that same threat is detected.

  6. Click Test Webhook - this will send some test data to your webhook endpoint.

  7. If the test is successful, click Create.

And that's it! You've successfully created a webhook trigger and configured it to create new issues in Jira 🎉

Did this answer your question?