Introduction

If you want to sync nFeed custom fields between JIRA instances and these fields are connected to the same database you should take into account that the new version of nFeed custom field(v5.13.0) does not accept an array of ids as a value.

Therefore, you need to convert ids to values. This article provides an example of the script which helps to sync the values of the nFeed custom field when each side uses different nFeed's versions.

Source side

Add this script to the Data Filter to send nFeed custom field's data

replica.customFields."nFeed custom field name" = issue.customFields."nFeed cusotm field name"
 

Destination side

Add this script to the Create/Change Processor to receive nFeed custom field's data 

// SYNC NFEED VALUES
({
    def _cfm = com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager()

    def syncNfeed = { String remoteCfName, String cfName->
        def _cfId = issue.customFields[cfName]?.id
        if (_cfId == null) {
            throw new com.exalate.api.exception.IssueTrackerException(
				"""Can not find custom field for name `${cfName}`.
	 			Please review your Exalate config or contact Exalate Support""".toString()
	)
        }
        def _cf = _cfm.getCustomFieldObject(_cfId)
        if (_cf == null) {
            throw new com.exalate.api.exception.IssueTrackerException(
				"""Can not find custom field for name `${cfName}` and id `${_cfId}`. 
				Please review your Exalate config or contact Exalate Support""".toString())
        }
        def _remoteCfValue = replica.customFields[remoteCfName]?.value
        if (_remoteCfValue == null) {
            return
        }
        def _remoteCfValueJsonArray = _remoteCfValue as com.google.gson.JsonArray
        def _remoteCfValues = new com.google.gson.Gson().fromJson(
	_remoteCfValueJsonArray, 
	new com.google.gson.reflect.TypeToken<List<String>>(){}.type
		)
        issue.customFields[cfName]?.value = _remoteCfValues?.collect { String v ->
            def _vObj = _cf.getCustomFieldType().getSingularObjectFromString(v?.toString())
            if (_vObj == null) {
                throw new com.exalate.api.exception.IssueTrackerException(
					"""Can not find value `$v` for custom field `${cfName}` ($_cfId). 
					Please review your Exalate config or contact Exalate Support""".toString())
            }
            _vObj
        }
    }
			//nFeed custom field name - sending custom field name and nFeed1 custom field name
    syncNfeed("nFeed custom field name","nFeed1 custom field name")
})()
// END: SYNC NFEED VALUES
 

See Also

How to sync nfeed fields when key values are different