Better Stack to Jira

Automatically create Uptime incidents from Jira by using our Outgoing Webhooks and Jira Automation.

To make this integration work flawlessly, the custom fields incident_id and BU_incident_url are recommended. You can find more details in Create an incident to Uptime from Jira.

Furthermore, you can also create your own custom fields depending on what data you'd like to extract by using the Smart values for Jira automation triggers*

1. Setting up Jira Automation Rule

  1. Go to the Jira Dashboard -> Project Settings -> Automation

    info

    If you'd like to apply this to all your projects, switch to the Global administration and apply the following to the Global rules

  2. Click on Create rule

  3. Select the Incoming webhook trigger and choose the No issues from the webhook in the Execute this automation rule with:* section. We'll get to the URL later.

    Jira Trigger.png

  4. Another step is to add the THEN: add an action and look for Create issue action.

    Webhooks Action Create Issue.png

  5. Here, fill in the Project you'd like the rule to apply for and Issue type Jira should create a ticket for when webhook is triggered, and also specify what Priority the ticket should be created with.

    info

    Customize your own Jira ticket content

    From now on, we'll be taking advantage of the Smart values for Jira automation triggers*, which enable us to easily fetch the Webhook's data and relay them accordingly.

  6. Now, we can also fill in the Summary. For example: {{webhookData.id}} - {{webhookData.attributes.name}} representing the Uptime Incident ID and a name of the incident.

  7. The Descriptioncan also be pretty much customized, as well as adding more details to your ticket, like incident_id or BU_incident_url to be a part of the pre-filled fields you can further work within Jira. You can select the Choose fields to set and then select the fields you'd like to fill in with the Webhook's data. An example could be:

 
A new Incident from Uptime has been created! 

Team:  {{webhookData.attributes.team_name}}
Incident ID: {{webhookData.id}}
Incident URL: {{webhookData.attributes.url}}
Name: {{webhookData.attributes.name}} 
HTTP Method:  {{webhookData.attributes.http_method}}

What's happened?

Cause: {{webhookData.attributes.cause}}
Regions:  {{webhookData.attributes.regions}}
Response URL: {{webhookData.attributes.response_url}}
Screenshot: {{webhookData.attributes.screenshot_url}}

Started at: {{webhookData.attributes.started_at}}

Status: {{webhookData.attributes.status}}

Incoming Webhooks Action.png

2. Setting up Outgoing Webhook from Uptime

  1. Now it's time to also configure the Webhook by going to the Integrations -> APIs -> Configure webhooks -> Incident webhook -> Add
  2. Give your webhook a name and then Copy&Paste the URL from the Jira automation rule's Webhook URL (in a form of https://automation.atlassian.com/pro/hooks/{{webhook_id}}).
  3. In the Advanced settings, keep the HTTP method to POST and include the Headers Content-Type: application/json.
  4. According to what you require in the Jira's description, adjust the Request body template. For example:
 
{
    "data": {
        "id": "$INCIDENT_ID",
        "type": "Incident",
        "attributes": {
            "name": "$NAME",
            "team_name": "$TEAM_NAME",
            "url": "$URL",
            "http_method": "$HTTP_METHOD",
            "cause": "$CAUSE",
            "started_at": "$STARTED_AT",
            "incident_url": "$INCIDENT_URL",
            "response_url": "$RESPONSE_URL", 
            "screenshot_url": "$SCREENSHOT_URL",
            "regions": $REGIONS,
            "status": "$STATUS"
        }
    }
}
  1. Click on Create webhook and we're done. After creation, you can also use the Send a test webhook to test out whether it works as expected in Jira.
success

That's all! 🎉

From now on, a new incident will be triggered in Uptime every time a new Jira ticket matching the conditions is created.

info

Need help with setting up the Jira Integration?

Please message us at hello@betterstack.com, and we will help you with all the necessary configurations.