Custom field synchronization in Jira

Originally asked by Harold Oconitrillo on 06 October 2023 (original question)


Hi, I have a problem with syncing external/ replica key to our custom field in Jira.

I tried the following but none of these work:

issue.customFields."External Ticket ID" = replica.key

issue.customFields."External Ticket ID".value = replica.key

‘External Ticket ID’ is a valid, text custom field in our Jira.

I would appreciate your support with this!

Thank you!


Answer by Javier Pozuelo on 10 October 2023

Hello,

Place the following in the Incoming Sync of the Source side (Internal Instance)

issue.customFields."External Ticket ID".value = replica.key

If the remote replica (Where the “External Ticket ID” is being sent from) is not sent, the custom field “External Ticket ID” will not be populated with the value of the external ticket ID.

Place the following code in the Incoming Sync of the “External Instance”

if(firstSync){
  syncHelper.syncBackAfterProcessing()
}  

The syncHelper.syncBackAfterProcessing() will trigger this message as it will queue a sync event which is handled as if the issue on external has been changed

If needed, you can read more about syncBackAfterProcessing() on our docs: https://docs.exalate.com/docs/syncbackafterprocessing-42631852

Regards,

Javier Pozuelo


Answer by Javier Pozuelo on 07 October 2023

Hello,

The following works when placed in the Incoming Sync in Jira Cloud

issue.customFields."External Ticket ID".value = replica.key