Jira Incoming Sync
if(firstSync){ issue.projectKey = "SYEDR" issue.typeName = "Task" def remoteIssueUrn = replica.customFields."Key"?.value if (remoteIssueUrn){ def g = new URL("https://red-demo.exalate.net/rest/api/latest/issue/" + remoteIssueUrn).openConnection(); g.setRequestMethod("GET") g.setDoOutput(true) g.setRequestProperty("Content-Type", "application/json") String userCredentials = "<username>:<password>"; String basicAuth = "Basic " + new String(Base64.getEncoder().encode(userCredentials.getBytes())); g.setRequestProperty("Authorization", basicAuth) def gRC = g.getResponseCode(); def id if (gRC.equals(200)) { String res = g.getInputStream().getText() id = res.split('\"id\":')[1].split(',')[0] } int a = Integer.parseInt(id.substring(1, id.length()-1)); issue.id = a } } issue.summary = replica.summary issue.description = replica.description issue.comments = commentHelper.mergeComments(issue, replica) issue.attachments = attachmentHelper.mergeAttachments(issue, replica) issue.labels = replica.labels