if(firstSync){ if ("story".equalsIgnoreCase(replica.entityType)) { issue.typeName = "Story" } else if ("incident".equalsIgnoreCase(replica.entityType)) { issue.typeName = "Bug" } else { // Don't sync anything but stories and bugs return } // use your project instead issue.projectKey = "SCRM" } issue.summary = replica.summary issue.description = replica.description issue.comments = commentHelper.mergeComments(issue, replica) issue.attachments = attachmentHelper.mergeAttachments(issue, replica) issue.labels = replica.labels /* User Synchronization (Assignee/Reporter) Set a Reporter/Assignee from the source side, if the user can't be found set a default user You can use this approach for custom fields of type User def defaultUser = nodeHelper.getUserByEmail("default@idalko.com") issue.reporter = nodeHelper.getUserByEmail(replica.reporter?.email) ?: defaultUser issue.assignee = nodeHelper.getUserByEmail(replica.assignee?.email) ?: defaultUser */ /* Comment Synchronization Sync comments with the original author if the user exists in the local instance Remove original Comments sync line if you are using this approach issue.comments = commentHelper.mergeComments(issue, replica){ it.executor = nodeHelper.getUserByEmail(it.author?.email) } */ /* Status Synchronization Sync status according to the mapping [remote issue status: local issue status] If statuses are the same on both sides don't include them in the mapping def statusMapping = ["Open":"New", "To Do":"Backlog"] def remoteStatusName = replica.status.name issue.setStatus(statusMapping[remoteStatusName] ?: remoteStatusName) */ /* Custom Fields This line will sync Text, Option(s), Number, Date, Organization, and Labels CFs For other types of CF check documentation issue.customFields."CF Name".value = replica.customFields."CF Name".value */