Integration of Priorities from JSM Customer Portal to OpsGenie
Asked by robin Dexter:

Hi there

I am new to OpsGenie and I am trying to help a colleague get the Priority for an issue logged in JSM Customer Service Portal transferred correctly across to OpsGenie via an Integration so it can be used in an OpsGenie Policy

The Portal is configured to allow a customer to log an issue with Issue Severities P1 to P4.

When the issue is logged in the Customer Service Portal it gets to JSM and fires off an OpsGenie integration to create an Alert.

The Priority in OpsGenie Alert is always set to P3 (default) regardless of the Issue Severity logged by the Customer.

Any guidance on how to troubleshoot this?

For example: Issue Logged by customer in the Portal with Severity P4

![1-Portal.png](/t5/image/serverpage/image-id/192772iD1EA72A91401D295/image-size/large?v=v2&px=999 "1-Portal.png")

Issue is logged correctly in JSM with Issue Severity of P4

![2-Logged JSM.png](/t5/image/serverpage/image-id/192773i5BA408B786D3B6E1/image-size/large?v=v2&px=999 "2-Logged JSM.png")

After Create Alert Action in Integration has fired -- Alert is created in OpsGenie with Priority of P3 - Moderate:

![3-OpsGenie Alert.png](/t5/image/serverpage/image-id/192774i746A0CB0DA0A9476/image-size/large?v=v2&px=999 "3-OpsGenie Alert.png")

Create Alert in Integration is as follows:

![4-Create Alert.png](/t5/image/serverpage/image-id/192775i929CE39081DB9100/image-size/large?v=v2&px=999 "4-Create Alert.png")


Answers:
author: Nick H
body: Hi [@robin Dexter](/t5/user/viewprofilepage/user-id/1630083) ,

Looks like the Severity of your JSM issues might be a custom field being sent from JSM \>\> Opsgenie.

If that's the case, and the values of the Severity field are P1 to P4, you should be able to map these to Opsgenie priorities using the [*Custom Value to Opsgenie Priority*](https://support.atlassian.com/opsgenie/docs/what-is-the-priority-level-of-integration/) option in the integration:

![cp1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/192780iBC96062F93A30168/image-size/large?v=v2&px=999 "cp1.jpg")

The example above uses:

```
{{_payload.issue.fields.customfield_12345.value}}
```

where customfield_12345 would be your Severity custom field number. Other formats that have worked in the past to extract custom fields:

```
{{_payload.issue.fields.customfield_12345}}

{{_payload.issue.fields.customfield_12345.name}}

{{_payload.issue.fields.customfield_12345.substringBetween("value=",",")}}
```

Realistically it would all depend how this field and value are being parsed in the payload.

To find the number and how it's being parsed, I typically suggest parsing the entire payload into the Description of these alerts for testing:

![cp2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/192781i960B56A453936035/image-size/large?v=v2&px=999 "cp2.jpg")

The number, format, value, etc. of your Severity field should be shown, and you can determine what might work best.

Hope that helps.

comments: author: robin Dexter
body: Thanks Nick for your prompt response. Will try your approach


author: robin Dexter
body: Hi Nick  
The suggestion to put the {{_payload}} in the Description really helped - much easier than trying to find the _payload contents in the logs.  
The {{_payload.issue.fields.customfield_10072.value}} clause was the one that worked for me  
Cheers


Tags: integration