1
0
-1

Hello, I'm attempting to map our Salesforce Priority to our Jira Priority values. I used the script mentioned in the Exalate resource, but it's defaulting to "Unprioritized" regardless off the remote Priority value. Am I missing something? Any assistance is appreciated. 


// Set Priority based on replica.priority
    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)

  1. Stéphane Thillay

    Naïve questions:

    • Is Priority__c  a string or an integer (if that has an impact on the key for the mapping).
    • If Priority__c is a picklist, you might want to look for the ".value" instead of ".name".
  2. Kaleigh Garcia

    Stéphane Thillay , that worked!! THANK YOU SO MUCH

CommentAdd your comment...

1 answer

  1.  
    2
    1
    0

    Kaleigh Garcia When checking the errors, please go and check the replica content, as Stéphane Thillay mentioned, it is possible that the replica payload has more of a structure, so it may be replica.Priority__c?.name.value or replica.Priority__c?.value.value

      CommentAdd your comment...