Create an incident

Automatically create Uptime incidents from Jira by using our Incidents API and Jira Automation.

1. Create custom fields in Jira

To automatically acknowledge and resolve incidents in Uptime from Jira, you need to create two custom fields: incident_id and BU_incident_url.

  1. In Jira, go to Settings โ†’ Issues โ†’ Fields โ†’ Custom fields.
  2. Click Create custom field.
  3. Select Short text (plain text only) and click Next.
    Custom field type.png
  4. Name the field incident_id and associate it with all screens.
  5. Repeat the process to create a BU_incident_url field.

2. Set up a Jira automation rule

  1. In your Jira project, go to Project Settings โ†’ Automation.

    To apply this to all projects, go to Global administration and create a global rule.

  2. Click Create rule.

  3. Select the Issue created trigger and click Save.

    Jira Trigger.png

  4. (Optional) Add a condition to specify when an incident should be created (e.g., for high-priority tickets).

    Jira Condition.png

  5. Add a new action and select Send web request.

    Jira Action.png

  6. Configure the web request:

    Web request URL: https://uptime.betterstack.com/api/v2/incidents
    Headers: Authorization: Bearer $TOKEN
    HTTP Method: POST
    Web request body: Custom data

    Custom data
    {
        "name": "{{issue.key}} - {{issue.summary}}",
        "summary": "{{issue.key}} - {{issue.summary}}",
        "requester_email": "{{reporter.emailAddress}}",
        "description": {{issue.description.asJsonString}},
        "policy_id": "{UPTIME_POLICY_ID}"
    }
    
  7. Check the box to Delay execution of subsequent rule actions.

  8. Add a new action and select Edit issue.

    Jira Edit Issue.png

  9. Set the incident_id field to {{webResponse.body.data.id}}.

  10. Add another field to set BU_incident_url to https://uptime.betterstack.com/team/{{YOUR_TEAM_ID}}/incidents/{{webResponse.body.data.id}}.

That's all. ๐ŸŽ‰

From now on, a new Uptime incident will be created for each new Jira ticket that matches your conditions.

Need help with the Jira integration?

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