Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Setting alerts responders in Opsgenie based on an Insight custom field in Jira

You can set the alerts responders field in OpsGenie based on an Insight custom field in Jira. Following the below steps you’ll be able to achieve that.

Insight Custom Field

Create a custom field in Jira with type Insight objects. This object needs to have an attribute to store the Team ID from Opsgenie:

f4397248-4837-4428-8a76-d00c50a94715.png

You can get the Team ID in Opsgenie by clicking on the relevant team on the Teams page and checking the ID on the URL:

2.png

Add this ID value to the attribute on the Insight custom field:

3.png

Add this custom field to the relevant project/screens.

Jira automation rule

Create an automation rule in Jira as specified below:

Trigger: choose the option Incoming webhook. Automation for Jira will create a Webhook URL, similar to the one below:

4.png
Copy the URL generated to be used in Opsgenie

Opsgenie integration

In Opsgenie create a new Webhook integration similar to the one below, using the URL generated by Jira automation:

5.png

6.png
Back to the Jira automation rule

Action: create a Lookup issues action using the response from the Webhook:

7.png

key = {{webhookData.alert.alias}}

Action: create another action Send web request to the Opsgenie Add Responder to Alert API:

8.png

URL: https://api.opsgenie.com/v2/alerts/{{webhookData.alert.alias}}/responders?identifierType=alias

Custom data:

{
     "responder": {
          "type":"team",
          "id":"{{lookupIssues.first.INSIGHT CUSTOM FIELD NAME.ATTRIBUTE NAME}}"
     }
}

It’s necessary to change the name of the Insight custom field and the attribute on the ”id” field.

This way, every time an alert is created based on a JSM ticket which has the Insight custom field, the responders will be set via API according to the value defined on the attribute.

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events