Help syncing custom fields between Salesforce and Jira

Originally asked by Ariel Aguilar on 28 September 2021 (original question)


We want to sync some SalesForce system fields (i.e. CaseNumber) to a Jira custom field (i.e. “Case Number”).

Following the documentation gives us the following entry in Jira Incoming:

issue.customFields.“Case Number”.value = replica.customFields.“CaseNumber”.value

With the following in Salesforce Outgoing:

replica.customFields.“Case Number” = issue.customFields.“CaseNumber”

This results in an error in SalesForce
No such property: issue for class: Script218

If we change SalesForce Outgoing to:

replica.customFields.“Case Number” = entity.customFields.“CaseNumber”

This results in an error at the Jira destination:
Cannot get property ‘value’ on null object

Finally, if I use:

replica.customFields.“Case Number” = entity.“CaseNumber”

We finally start to see the expected value (Case # 00001143), but it’s an error in Salesforces outgoing:

Unexpected error occurred. The customfield `Case Number` was assigned to `value=00001143 class=java.lang.String`, but it should have been set to a custom field object Generate an exalate support.zip file and contact support.


Comments:

Ariel Aguilar commented on 28 September 2021

Maybe you can try:

Salesforce Outgoing:

replica.entity."CaseNumber" = entity."CaseNumber"

Jira incoming:

issue.customFields."Case Number".value = replica.entity."CaseNumber".value

Let me know if this works for you.

Kind regards,

Ariel

Justin commented on 29 September 2021

Hi Ariel,

Unfortunately the above results in this error on the outgoing Salesforce side:

Error Detail Message:

Cannot set property ‘CaseNumber’ on null object

I also tried the following for good measure; same error.

replica.entity."Case Number" = entity."CaseNumber"

Thank you,
Justin