# I want to send the JIRA Priority on a Ticket to Salesforce Cases

**URL:** <https://community.exalate.com/t/i-want-to-send-the-jira-priority-on-a-ticket-to-salesforce-cases/6029>\
**Category:** General Questions\
**Created:** [December 9, 2024, 9:13pm UTC](https://community.exalate.com/t/i-want-to-send-the-jira-priority-on-a-ticket-to-salesforce-cases/6029 "2024-12-09T21:13:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob\_Kalaj](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/jacob_kalaj/32/411_2.png) [@Jacob\_Kalaj](https://community.exalate.com/u/Jacob_Kalaj)\
**Post date:** [December 9, 2024, 9:13pm UTC](https://community.exalate.com/t/i-want-to-send-the-jira-priority-on-a-ticket-to-salesforce-cases/6029/1 "2024-12-09T21:13:30Z")

</div>

I am having issues with the exalate script, I keep getting the error

Unexpected error occurred. The customfield `JiraPriority` was assigned to `value=P1 class=java.lang.String`, but it should have been set to a custom field object

The goal is to take the JIRA Priority (po, p1 etc) and surface it in a text field on the Salesforce Case

**incoming script sales force**

entity.Jira\_Eng\_Priority\_\_c = replica.customFields.“Jira\_Eng\_Priority\_\_c”.value.value

**outgoing script JIRA**  
replica.customFields.“Jira\_Eng\_Priority\_\_c” = issue.priority

this script combo has worked for my custom pick list fields from JIRA \>\>\> SFDC but not for default fields

---

<div class="post-metadata">

**Author:** ![Javier](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/javier/32/338_2.png) [@Javier](https://community.exalate.com/u/Javier)\
**Post date:** [December 10, 2024, 1:03am UTC](https://community.exalate.com/t/i-want-to-send-the-jira-priority-on-a-ticket-to-salesforce-cases/6029/2 "2024-12-10T01:03:25Z")

</div>

Hi @Jacob_Kalaj,

It looks like the **Salesforce field** `entity.Jira_Eng_Priority __c` expects an **object** rather than a string. In that case, you’ll need to assign the entire `replica.customFields."Jira_Eng_Priority__ c"` object instead of just its value.

Could you try the following in the **Salesforce Incoming script** :

```
entity.Jira_Eng_Priority __c = replica.customFields.“Jira_Eng_Priority__ c”

```

Or

` entity.Jira_Eng_Priority __c = replica.customFields.“Jira_Eng_Priority__ c”.name`

Let me know if this resolves the issue!

---

<div class="post-metadata">

**Author:** ![Jacob\_Kalaj](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/jacob_kalaj/32/411_2.png) [@Jacob\_Kalaj](https://community.exalate.com/u/Jacob_Kalaj)\
**Post date:** [December 10, 2024, 1:57am UTC](https://community.exalate.com/t/i-want-to-send-the-jira-priority-on-a-ticket-to-salesforce-cases/6029/4 "2024-12-10T01:57:43Z")

</div>

> [@Javier](#):
>
> ```auto
> entity.Jira_Eng_Priority __c = replica.customFields.“Jira_Eng_Priority__ c”
> 
> ```

**I get this error** Unexpected error occurred. The customfield `Jira_Eng_Priority__c` was assigned to `value=com.exalate.basic.domain.hubobject.v1.BasicHubPriority@fef class=com.exalate.basic.domain.hubobject.v1.BasicHubPriority`, but it should have been set to a custom field object

**and with** entity.Jira\_Eng\_Priority\_\_c = replica.customFields.“Jira\_Eng\_Priority\_\_c”.name

I get this error Unexpected error occurred. The customfield `Jira_Eng_Priority__c` was assigned to `value=com.exalate.basic.domain.hubobject.v1.BasicHubPriority@fef class=com.exalate.basic.domain.hubobject.v1.BasicHubPriority`, but it should have been set to a custom field object

---

<div class="post-metadata">

**Author:** ![Javier](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/javier/32/338_2.png) [@Javier](https://community.exalate.com/u/Javier)\
**Post date:** [December 10, 2024, 2:07am UTC](https://community.exalate.com/t/i-want-to-send-the-jira-priority-on-a-ticket-to-salesforce-cases/6029/5 "2024-12-10T02:07:41Z")

</div>

Could you share the payload of the Jira replica? Where it shows replica.customFields.“Jira\_Eng\_Priority\_\_c”?

---

<div class="post-metadata">

**Author:** ![Majid](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/majid/32/343_2.png) [@Majid](https://community.exalate.com/u/Majid)\
**Post date:** [December 10, 2024, 3:51am UTC](https://community.exalate.com/t/i-want-to-send-the-jira-priority-on-a-ticket-to-salesforce-cases/6029/7 "2024-12-10T03:51:55Z")

</div>

As you said, you are taking across a system field (not a custom field) from Jira. So, I would keep the Jira outgoing simple i.e.  
`replica.priority = issue.priority`  
_This line is usually part of the default scripts anyway._

Now if you [look at the replica payload](https://exalate.com/academy/?playlist=0c1f98f&video=45c6e81) arriving in SF, you should be able to visually inspect the the priority data structure, and the attribtue you want from there is name. So, SF incoming would look like:  
`entity.Jira_Eng_Priority__c = replica.priority?.name`

The ? (aka [safe navigation operator](https://exalate.com/academy/?playlist=0c1f98f&video=3f7b059)) is not needed, but is useful to have.

Hope it helps!

Thanks  
Majid

---

<div class="post-metadata">

**Author:** ![Jacob\_Kalaj](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/jacob_kalaj/32/411_2.png) [@Jacob\_Kalaj](https://community.exalate.com/u/Jacob_Kalaj)\
**Post date:** [December 10, 2024, 4:29am UTC](https://community.exalate.com/t/i-want-to-send-the-jira-priority-on-a-ticket-to-salesforce-cases/6029/8 "2024-12-10T04:29:04Z")

</div>

so here is what ended up working thus far, but I might add the ? to see if it helps , same thinking I ended up having @Majid ! This is working for Status, Key and for Priority from JIRA Standard Fields \>\>\> SFDC Custom Fields @Javier

**JIRA Outgoing**  
replica.priority = issue.priority  
replica.status = issue.status  
replica.key = issue.key

**SFDC Incoming**  
entity.Jira\_Eng\_Priority\_\_c = replica.priority.name  
entity.Jira\_ID\_\_c = replica.key  
entity.Jira\_Status\_\_c =replica.status.name

---

<div class="post-metadata">

**Author:** ![Jacob\_Kalaj](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/jacob_kalaj/32/411_2.png) [@Jacob\_Kalaj](https://community.exalate.com/u/Jacob_Kalaj)\
**Post date:** [December 10, 2024, 4:30am UTC](https://community.exalate.com/t/i-want-to-send-the-jira-priority-on-a-ticket-to-salesforce-cases/6029/9 "2024-12-10T04:30:25Z")

</div>

I wanted the Key to reflect in a SFDC field so that I can hide the exalate widget from non admins, then created another SFDC that Formulates the ID and adds it to the Atlassian URL our teams can still link to the JIRA ticket so far everything is working

---

<div class="post-metadata">

**Author:** ![Majid](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/majid/32/343_2.png) [@Majid](https://community.exalate.com/u/Majid)\
**Post date:** [December 10, 2024, 4:32am UTC](https://community.exalate.com/t/i-want-to-send-the-jira-priority-on-a-ticket-to-salesforce-cases/6029/10 "2024-12-10T04:32:31Z")

</div>

Ye, that looks perfect actually! Glad that it worked! The piece that you were getting wrong was trying to push the system priority into a custom field replica object.

So the ? is always good as it protects you in case the other side send nulls.

Please mark the answer as accepted, but let us know if you run into any other issues please.

Thanks  
Majid

---

<div class="post-metadata">

**Author:** ![Jacob\_Kalaj](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/jacob_kalaj/32/411_2.png) [@Jacob\_Kalaj](https://community.exalate.com/u/Jacob_Kalaj)\
**Post date:** [December 10, 2024, 5:02am UTC](https://community.exalate.com/t/i-want-to-send-the-jira-priority-on-a-ticket-to-salesforce-cases/6029/11 "2024-12-10T05:02:34Z")

</div>

thank you guys again, appreciate the Exalate team as always. will be leaving reviews for you both!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/system/32/3_2.png) [@system](https://community.exalate.com/u/system)\
**Post date:** [December 11, 2024, 5:02am UTC](https://community.exalate.com/t/i-want-to-send-the-jira-priority-on-a-ticket-to-salesforce-cases/6029/12 "2024-12-11T05:02:45Z")

</div>

Closed on December 11, 2024, 5:02am UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
