if (firstSync) {
issue.projectKey = “DTT”
// Set the same issue type as the source issue. If not found, set a default.
replica.issueTypeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: “Request”
}
if(replica.issueTypeName == “Request”) { // if the received issue typeName is Improvement create Request Item on ServiceNow
if (firstSync) {
// For the first sync: Decide the entity you want to create based on the remote issue type
entity.tableName = "“sc_req_item”"
}
if (entity.tableName == "sc_req_item") {
entity.short_description = replica.summary
entity.description = replica.description
entity.attachments += replica.addedAttachments
entity.comments += replica.addedComments
}
// Sync any other entity using the table name and the entity variable
if (entity.tableName == "cmdb_ci_business_app") {
entity.short_description = replica.summary
entity.description = replica.description
}
Jira Outgoing
No change to default scripts
Jira Incoming
if (firstSync) {
issue.projectKey = "CM"
// Set the same issue type as the source issue. If not found, set a default.
issue.typeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Task"
}
issue.summary = replica.summary
issue.description = replica.description
issue.comments = commentHelper.mergeComments(issue, replica)
issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
issue.labels = replica.labels
Looking at some of your documentation, I was under the understanding that I had to use the prefix of “requestItem” for the Jira incoming script rather than “issue”. This makes a lot more sense now.
Hi Majid
Yes, I have successfully set-up the initial bi-directional flow based on your update. I now have a new query regarding RITM variables which I will raise a new question on.
Many thanks again for your assistance and help on this.