mapping custom priorities with jira service management cloud integration
Asked by Kenneth Kharma:

what is the best way to map custom priorities in jira to opsgenie priorities when using the jira service management cloud integration? the legacy integration has a direct means of doing this via the "Custom Value to Opsgenie Priority" option, but the new cloud integration seems to lack this option.

also, are custom fields accessed the same way when using the cloud integration (via _payload)?

i came across the following article, but it references the legacy automation:

<https://community.atlassian.com/t5/Opsgenie-articles/How-to-Map-Alert-Priorities-in-Opsgenie/ba-p/2044304>


Answers:
author: Nick H
body: Hi [@Kenneth Kharma](/t5/user/viewprofilepage/user-id/2465589) ,

Although that article does reference the Legacy integration, the idea should be the same with section **1 - Advanced integration settings**- configuring multiple create alert actions that filter on the priority being sent from JSM, and mapping to the corresponding Opsgenie alert priority with the JSM cloud integration. For example:

![jsmcloud1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/215533i659774892AE7284C/image-size/large?v=v2&px=999 "jsmcloud1.jpg")![jsmcloud2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/215534i721D527879F309A5/image-size/large?v=v2&px=999 "jsmcloud2.jpg")![jsmcloud3.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/215535i4C80352EB5754030/image-size/large?v=v2&px=999 "jsmcloud3.jpg")

Like you mentioned, the new JSM cloud integration does not have the Custom Value to Opsgenie Priority option available at this time.

comments: author: Kenneth Kharma
body: thanks [@Nick H](/t5/user/viewprofilepage/user-id/2540930) ... if our priority comes from a custom field, will we need to stick with the legacy integration for now?

is there any way to access custom fields in the new integration, e.g. for text output or otherwise?


author: Kenneth Kharma
body: [@Nick H](/t5/user/viewprofilepage/user-id/2540930) could you comment on the above questions? thanks!


author: Nick H
body: Hi [@Kenneth Kharma](/t5/user/viewprofilepage/user-id/2465589) ,

Since the *Custom Value to Opsgenie Priority* option is not available in the JSM cloud integration, in my opinion it would be easier to use the JSM legacy integration.

Having said that, the JSM cloud integration could still be used, but would require also configuring alert policies that filter on the custom field being extracted into the alert. That is covered here in step 3: [How to Map Alert Priorities in Opsgenie](https://community.atlassian.com/t5/Opsgenie-articles/How-to-Map-Alert-Priorities-in-Opsgenie/ba-p/2044304)

This article might help as well if you're looking at hints on how to extract a custom field: [How to Extract Custom Fields and Data into an Alert](https://community.atlassian.com/t5/Opsgenie-articles/How-to-Extract-Custom-Fields-and-Data-into-an-Alert/ba-p/2133902)

We also have a similar feature request for mapping Jira / JSM priorities you can follow, watch and vote for here: <https://jira.atlassian.com/browse/OPSGENIE-587>


author: Kenneth Kharma
body: here is what i ended up implementing. per nick's suggestion, i used option 3 from [How to Map Alert Priorities in Opsgenie](https://community.atlassian.com/t5/Opsgenie-articles/How-to-Map-Alert-Priorities-in-Opsgenie/ba-p/2044304). i extracted our custom priority field into an extra property and created alert policies to do the priority mappings. i had some difficulty finding a custom field extraction that worked. here is what i ended up using: {{customFields.customfield_XXXXX.substringBetween("value=",",")}}

for some reason, {{customFields.customfield_XXXXX.value}} was not parsing properly.


Tags: jira-service-management-cloud