We’re syncing issues between two Jira Cloud sites, which include asset fields. However, we’re unable to get the asset fields to sync properly between the two instances. We reviewed the documentation provided in the link, but the suggested solution isn’t working—it results in a null value, and the destination field isn’t getting updated.
Syncing asset (Insight) fields between two Jira Cloud sites where object keys differ but object names are the same requires a mapping approach, since the default script in the documentation assumes the object keys are identical on both sides.
The standard method from the documentation (How to Sync Insight Custom Fields) serializes the asset field values as strings and then deserializes them on the destination. However, if the object keys differ, this will result in nulls or failed updates, as you’ve experienced.
To handle this, you’ll need to:
Sync the object names (not keys) from the source.
On the destination, look up the asset object by name and set the field accordingly.
I have tried what you have given in the incoming sync final def insightCustomFieldName = “Assets”
def cfm = com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager()
def cf = cfm.getCustomFieldObject(issue.customFields[insightCustomFieldName].id)
def cft = cf.getCustomFieldType()
def insightObjects = com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade
def objectFacade = com.atlassian.jira.component.ComponentAccessor.getOSGiComponentInstanceOfType(insightObjects)
issue.customFields[insightCustomFieldName].value = replica.customKeys.assetNames.collect { assetName →
// Replace “INSIGHT_SCHEMA_ID” with your actual schema ID
def objects = objectFacade.findObjects(“objectType = Asset AND Name = \”${assetName}\“”, “INSIGHT_SCHEMA_ID”)
objects ? objects[0] : null
} but got below error Error Detail Message:
The documentation you are referring to only works for Insight field sync between 2 Jira On-Prem Instances.
Since the instance that you are using is a Jira Cloud instance, this will not work for you.
Exalate does not support the sync of Insight objects for Jira Cloud directly and the only workaround here is to use httpClient() and do custom scripting.