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

Setting priority to tickets in JSM generated from Opsgenie alerts

Andrés Enrique Cárdenas March 17, 2023

I have an integration with Zabbix setup, and I have already modified the integration, so it matches the P1-P5 schema using our Zabbix priority (so disaster is P1, high P2, warning P3, etc, etc). This is working perfectly; the alerts are created accordingly:

image.png

 

I have another integration that takes this alert and creates an Incident issue in Jira, this works fine, but every incident that creates is raised with the equivalent of a P3 ticket (in our case we have set it up as P2 is High, P3 is Medium, P4 is low, P5 is informational. 

image.png

 

all of the tickets are being created as "Medium".

 

The last log from this integration looks like this:

{
"_outgoingData": {
"_headers": {
"-Content-Type": [
"application/json;charset=UTF-8"
],
"-Authorization": [
"Basic............."
]
},
"integrationType": "JiraServiceDesk",
"_payload": {
"_fields": {
"summary": "[Zabbix] System audit policy was changed",
"-labels": [
"----"
],
"_project": {
"key": "..."
},
"_issuetype": {
"name": "Incident"
},
"description": ".........."
}
},
"integrationName": "Opsgenie to JIRA"
},
"alertLogOwner": "System",
"alertId": "......",
"alertLogType": "system"
}

I don't see anything reated to the priority in there...

I tried doing the same that I did with the Zabbix alerts and modify the priority parameter, but I couldn't get it to raise the ticket with the right priority.

I'd appreciate any guidance you can provide, thanks! 

1 answer

0 votes
Oday Rafeh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 17, 2023

Hi @Andrés Enrique Cárdenas 

I will try to help you here, 

To set the priority of the Jira Service Management (JSM) tickets generated from Opsgenie alerts, you'll need to map the priority from Opsgenie to the corresponding priority in JSM. You can do this by modifying the payload in the Opsgenie to Jira integration.

Please Follow these steps:

  • In Opsgenie, navigate to the "Integrations" page.
  • Locate your Jira Service Management integration and click on the "Settings" button (gear icon).
  • Scroll down to the "Create Jira Issue" section and click on "Edit".
  • In the "Create Jira Issue" action, you need to add the priority mapping in the payload. You can do this by including the priority field in the _fields section of the payload.

I wrote an example of how you can map Opsgenie priority levels to Jira priorities:

{ "_fields": { "summary": "Your summary here", "labels": ["label1"], "project": {"key": "YourProjectKey"}, "issuetype": {"name": "Incident"}, "description": "Your description here", "priority": {"name": "{{#equalsString alert.priority 'P1'}}High{{/equalsString}}{{#equalsString alert.priority 'P2'}}Medium{{/equalsString}}{{#equalsString alert.priority 'P3'}}Low{{/equalsString}}{{#equalsString alert.priority 'P4'}}Lowest{{/equalsString}}{{#equalsString alert.priority 'P5'}}Informational{{/equalsString}}"} } }

In this example, the priority field in Jira is set based on the priority value of the alert in Opsgenie. Make sure to replace the priority names with the appropriate values for your Jira instance.

  • Save your changes.

Now, when an alert is created in Opsgenie, the corresponding JSM ticket should be created with the correct priority based on the mapping in the payload.

I hope to hear form your side as soon as you get any results. 

Andrés Enrique Cárdenas March 17, 2023

thanks! I'll try and let you know how it goes :D 

Like Oday Rafeh likes this
Andrés Enrique Cárdenas March 22, 2023

Hi Oday,

We might have a different version of Opsgenie or Jira integration, I don't see the edit or gear icon in the integrations page. This is how it looks on the "create jira issue" no option to edit the action there:

image.png

below this I see on the alert fields there's the priority, but I have not been able to set the parameters as per your example:

image.png

not sure where to change this

Markus
Contributor
February 1, 2024

@Andrés Enrique Cárdenas did you find an answer? :-) 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events