# Mapping Salesforce Priority to Jira Priority with no success using mapping script

**URL:** <https://community.exalate.com/t/mapping-salesforce-priority-to-jira-priority-with-no-success-using-mapping-script/5650>\
**Category:** General Questions\
**Tags:** cloud-salesforce, exalate, cloud-jira, migrated\_question\
**Created:** [November 4, 2024, 8:19am UTC](https://community.exalate.com/t/mapping-salesforce-priority-to-jira-priority-with-no-success-using-mapping-script/5650 "2024-11-04T08:19:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:19am UTC](https://community.exalate.com/t/mapping-salesforce-priority-to-jira-priority-with-no-success-using-mapping-script/5650/1 "2024-11-04T08:19:24Z")

</div>

_Originally asked by Kaleigh Garcia on 21 February 2024 [(original question)](https://oldcommunity.exalate.com/questions/108921025)_

* * *

Hello, I’m attempting to map our Salesforce Priority to our Jira Priority values. I used the script mentioned in the [Exalate resource](https://docs.exalate.com/docs/use-cases-how-to-sync-issue-priority-fields-in-jira-cloud), 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)

```

* * *

#### Comments:

> **Stéphane Thillay commented on 21 February 2024**
>
> > 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”.

> **Kaleigh Garcia commented on 21 February 2024**
>
> > Stéphane Thillay , that worked!! THANK YOU SO MUCH

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:19am UTC](https://community.exalate.com/t/mapping-salesforce-priority-to-jira-priority-with-no-success-using-mapping-script/5650/2 "2024-11-04T08:19:25Z")

</div>

_Answer by Hernan Montes on 21 February 2024_

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

* * *
