Originally asked by Moogambigai G R on 11 February 2022 (original question)
Hi Team,
We have a scripted connection for outgoing and incoming in same instance.
Below is the configuration used in outgoing and incoming script.
Here we tried to sync subtask to destination side, but is not syncing and didn’t get any error.
Please help on this.
Outgoing side:
if (issue.project.key == "DAR" && issue.typeName == "Defect")
{
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
replica.resolution = issue.resolution
replica.status = issue.status
replica.parentId = issue.parentId
replica.attachments = issue.attachments
replica.project = issue.project
replica.priority = issue.priority
//DAR Fields
//exposes the value of custom field in project A to the scripting for project B
replica.customFields."11030" = issue.customFields."11030" //Defect Change Type//OEM Defect Change Type
replica.customFields."10113" = issue.customFields."10113" //Customer Severity//OEM Customer
}
Incoming side:
if(replica.project.key == "DAR" && replica.type.name == "Defect") //sync A -> B
{
issue.projectKey = "OEM"
def issueTypeMapping = [
"Defect" : "Acquired Product Defect"
]
issue.typeName = issueTypeMapping[replica.type?.name] ?: "Acquired Product Defect"
issue."17004" = replica."11030" //Defect Change Type//OEM Defect Change Type
issue."17006" = replica."10113" //Customer Severity//OEM Customer Severity
if(replica.parentId){
issue.typeName = "Action Item" //Make sure to use the right subtask type here.
def localParent = nodeHelper.getLocalIssueFromRemoteId(replica.parentId.toLong())
if(localParent){
issue.parentId = localParent.id
} else {
throw new com.exalate.api.exception.IssueTrackerException("Subtask cannot be created: parent issue with remote id " + replica.parentId + " was not found. Please make sure the parent issue is synchronized before resolving this error" )
}
}
issue.summary = replica.summary
issue.description = replica.description
issue.comments = commentHelper.mergeComments(issue, replica)
issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
issue.labels = replica.labels
issue.assignee = replica.assignee
issue.reporter = replica.reporter
issue.resolution = replica.resolution
issue.status = replica.status
issue.priority = replica.priority
issue.key = replica.key
}