Jira Cloud - Mapping Priority values

Originally asked by Jacob Pines on 29 May 2023 (original question)


Hi,

We are connected from our Jira using Exalate to another remote location also using Jira, both Cloud.

The remote location has and uses a lot more Priority options while we only use 4. So when we get 1 that we do not have it receives the Default Value for the field.

I wanted to know if and how I can map the Values we get from Remote to the ones we use locally.

This is needed just 1 way, since what we use does exist on Remote so no need for mapping.

I tried to use a few of the existing questions/topics here with similar request, but did not find one that matches this scenario.

Priorities:

(Local <---- Remote)

  • Blocker <---- Blocker
  • High <---- High, Critical
  • Medium <---- Medium, Major
  • Low <---- Low, Minor, Trival

Let me know if you need additional information to assist.

Thanks in advance.


Comments:

Kaleigh Garcia commented on 21 February 2024

Jacob Pines I’m attempting to do the same, but it’s not mapping as expected… Did you solve this with Kevin Yorston 's solution? My code is below… Not sure if I’m missing something…?

// Set Priority based on replica.Priority__c
def priorityMapping = [
“1”: “P0 - Critical / Widespread”,
“2”: “P1 - Critical / Contained”,
“3”: “P2 - Noncritical / Widespread”,
“4”: “P3 - Noncritical / Contained”,
]

def priorityName \= priorityMapping\[replica.Priority\_\_c?.name] ?: "Unprioritized" // set default priority in case priority isn't found  
issue.priority \= nodeHelper.getPriority(priorityName)

Answer by Kevin Yorston on 29 May 2023

Hi Jacob,

If you want to map the priority just from one of the sides you will to add the following snippet to the Incoming of that instance. Please bear in mind that the Priority needs to exist on the incoming project and needs to be typed exactly as it was typed on the mapping.

def priorityMapping = [
        // remote side priority <-> local side priority             
          "Blocker" : "Blocker",
    	  "High"	: "High",
		  "Critical" : "High",
		  "Medium"	: "Medium",
		  "Major" 	: "Medium",
		  "Low" 	: "Low",
		  "Minor" 	: "Low",
		  "Trivial" : "Low" 
    ]
def priorityName = priorityMapping[replica.priority?.name] ?: "Low" // set default priority in case the proper urgency could not be found
issue.priority = nodeHelper.getPriority(priorityName)

I al providing the Exalate page were the priority mapping is explained.

How to sync Issue priority field