This article shows how to synchronize the issue resolution field in Jira.

Introduction

Whenever you need to sync the resolution, you have to ensure that the resolution from the remote side is mapped to the local resolution objects.

Source side

Add the code below to the Outgoing sync to send a resolution to the other side.

replica.resolution = issue.resolution



Destination side  

Add the code below to the  Incoming sync to set the resolution for the synced issue, based on the source side data.

if (replica.resolution == null && issue.resolution != null) {
   // if the remote issue is not resolved, but the local issue is set, then clear the local issue resolution
 
   issue.resolution = null
}
 
if (replica.resolution != null && issue.resolution == null) {
   // the remote issue is resolved, but the local isn't - look up the correct local resolution object.


   def resolutionMap = [
        "Done" : "Done",
        "Won't Do" : "Won't Do",
        "Known Error" :  "Won't Fix"
   ]
 
   // use 'done' as resolution if the remote resolution is not found
   def targetResolutionName = resolutionMap[replica.resolution.name] ?: "Done"
   
   // nodeHelper.getResolution looks up the local resolution object based on the provided name
   issue.resolution = nodeHelper.getResolution(targetResolutionName)
}


See also