Sync Issue: SN Priority Field (ServiceNow to Jira)

Hi team,

I would like to request support for mapping the ServiceNow priority field’s display values (e.g., “1 - Critical“) to Jira values (P1, P2, etc.).

Can you help us to configure this through a value mapping script in the Exalate sync

please find the script details below.

SNOW Outgoing script:
replica.priority = entity.priority

**Jira Incoming script:
**
def priorityMapping = [

"1 - Critical": "P1",

"2 - High"  : "P2",

 "P3": "2 - Medium",

"3 - Moderate": "P3",

"4 - Low"    : "P4"

]

if (replica.priority && priorityMapping.containsKey(replica.priority)) {

issue.customFields."SN Priority(Severity)".value = priorityMapping\[replica.priority\]

}**
**
And I have raised a request in the Support portal also**[Sync Issue: SN Priority Field (ServiceNow to Jira) - Exalate Support Portal - Jira Service Management]**

Please let us know if this is the correct approach or if any adjustments are required.

Thank you,
Veeresh

Hi @Veeresh ,

Thank you for being a part of Exalate Community.

As you have also opened the Support ticket, and I provided a solution there. We will be posting the same final working solution once I receive a confirmation from you.

Thank you,

Ashar

Hi @Veeresh ,

As per your confirmation in the Support ticket, the following suggested modification has worked for you.

On the line 04 in this snippet, and on the left side you have mentioned Jira’s Priority value instead of ServiceNow’s Priority value. Please correct it and try again.

def priorityMapping = [
    "1 - Critical": "P1",
    "2 - High"    : "P2",
     "P3" : "2 - Medium"  ,
    "3 - Moderate": "P3",
    "4 - Low"     : "P4"
]

if (replica.priority && priorityMapping.containsKey(replica.priority)) {
    issue.customFields."SN Priority(Severity)".value = priorityMapping[replica.priority]
}

Kind regards,

Ashar