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
It looks like the Salesforce fieldentity.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:
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
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 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
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
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
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.