_____________ ZD Outgoing _____________ replica.key = issue.key replica.assignee = issue.assignee replica.reporter = issue.reporter replica.summary = issue.summary replica.description = issue.description replica.type = issue.type replica.labels = issue.labels replica.attachments = issue.attachments replica.comments = issue.comments.findAll {!it.internal} replica.status = issue.status def orgId = issue.organization_id if(orgId){ def orgName = httpClient.get("/api/v2/organizations/"+(long)orgId+".json").organization.name replica.customKeys."Organization" = orgName } replica.customFields."Jira Ticket" = issue.customFields."Jira Ticket" _____________ ZD Incoming _____________ issue.labels = replica.labels //issue.summary = replica.summary issue.description = replica.description ?: "No description" issue.attachments = attachmentHelper.mergeAttachments(issue, replica) //issue.comments += replica.addedComments issue.comments = commentHelper.mergeComments(issue, replica, { comment -> comment.internal = true comment } ) def statusMapping = ["To Do": "new", "In Progress":"pending", "Done":"solved"] def remoteStatusName = replica.status.name issue.setStatus(statusMapping[remoteStatusName] ?: remoteStatusName) _____________ Jira Outgoing _____________ replica.key = issue.key replica.type = issue.type replica.assignee = issue.assignee replica.reporter = issue.reporter replica.summary = issue.summary replica.description = issue.description replica.labels = issue.labels replica.comments = issue.comments.findAll {it.body =~ /\[ZD:\]*/ } replica.resolution = issue.resolution replica.status = issue.status replica.parentId = issue.parentId replica.priority = issue.priority replica.attachments = issue.attachments replica.project = issue.project //Comment these lines out if you are interested in sending the full list of versions and components of the source project. replica.project.versions = [] replica.project.components = [] _____________ Jira Incoming _____________ if(firstSync){ issue.projectKey = "CM" // Set type name from source issue, if not found set a default. issue.typeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Task" def remoteIssueUrn = replica.customFields."Jira Ticket"?.value if(remoteIssueUrn){ def localIssue = httpClient.get("/rest/api/2/issue/"+remoteIssueUrn) if(localIssue == null) throw new com.exalate.api.exception.IssueTrackerException("Issue with key "+remoteIssueUrn+" was not found") //debug.error(localIssue) issue.id = localIssue?.id issue.key = localIssue?.key def newData = httpClient.get("/rest/api/latest/issue/"+issue.key) //debug.error("${newData.fields.customfield_10092}") issue.customFields."Environment".value = newData.fields.customfield_10092 + "\nOrg:" + replica.customKeys."Organization" + "\t\tTicket num from ZD: " + replica.key return; } issue.summary = replica.summary issue.description = replica.description issue.customFields."Environment".value = "Org:" + replica.customKeys."Organization" + "\t\tTicket num from ZD: " + replica.key } issue.comments = commentHelper.mergeComments(issue, replica) issue.attachments = attachmentHelper.mergeAttachments(issue, replica) issue.labels = replica.labels