Create an incident ticket in JSM once an alert has been open for X minutes
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
Note: this article applies to Jira Service Management on a Premium or Enterprise Cloud plan.
In Jira Service Management Automation, we can create a JSM incident ticket based on an alert creation event in Opsgenie. In addition, we can delay the ticket creation until the alert has been open for a selected length of time.
Solution
Imagine we want to create a JSM incident once an Alert event has been open for 30 minutes.
Build the Automation rule
Access Your Team in Jira:
Navigate to the Teams option in the upper menu of Jira.
Search for your team and access its page.
Navigate to Operations:
On your team's page, locate the Operations section.
Select Go to operations.
Select Automation > Create Automation.
Select Trigger on Alert Creation to start the automation when a new alert is created.
Add a log action to capture the alert ID using the smart value
{{alert.id}}Add Delay Actions:
Add a delay action for 15 minutes.
Add another delay action for an additional 15 minutes, totaling a 30-minute delay.
Check Alert Status:
Use the Send web request action to check the alert status.
Configure the request to use the Get Alert Operations API pass the
{{alert.id}}smart value to retrieve the current status of the alert:https://api.atlassian.com/jsm/ops/api/{cloudId}/v1/alerts/{{alert.id}}
Optional: Add a log action of the
{{webResponse.body.status}}to check the status received in the web response body to the Audit log for verification purposes.Add a condition to check if the web response body status is equal to "open." See the below screenshot:
Create Incident:
If the condition is met, add an action to create an incident.
Select the appropriate project and incident type for the ticket.
Save and Run:
Save the automation setup.
Ensure the automation is active and ready to run when triggered by an alert creation event.
Was this helpful?
