Sub task are not syncing in destination

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
}

Answer by Francis Martens (Exalate) on 11 February 2022

Was the exalate operation triggered on the subtask?


Comments:

Moogambigai G R commented on 14 February 2022

Hi Francis,

No, we didn’t put any trigger for subtask, i was trying to sync when parent issue is synced to destination subtask also sync.

Moogambigai G R commented on 14 February 2022

Hi Francis,

Is there any configuration to sync subtask when parent sync in Jira server?

Moogambigai G R commented on 17 February 2022

Hi Francis,

Is there any update?

Regards,

Moogambigai G R

Francis Martens (Exalate) commented on 20 February 2022

Check out following Atlassian community article
https://community.atlassian.com/t5/Jira-articles/How-to-use-script-runner-to-automatically-exalate-subtasks/ba-p/1950068#M6209

Moogambigai G R commented on 21 February 2022

Thank you Francis, it’s work great.

Moogambigai G R commented on 08 March 2022

Hi Francis Martens (Exalate)

Is there any same way to unexalate subtask when parent is unexalated?

Regards,

Moogambigai G R

Francis Martens (Exalate) commented on 08 March 2022

The approach can be the same. An unexalate event will be raised whenever an unexalate is completed. I guess it is a good exercise to adapt the code.

Moogambigai G R commented on 08 March 2022

Hi Francis Martens (Exalate)

I have used the same configuration, instead of selecting exalate in listener, i have selected below one.

But when i unexlated the parent record, subtask is not unexalated, still showing a destination link in subtask.

Moogambigai G R commented on 10 March 2022

Hi Francis Martens (Exalate)

Hope you are doing good.

Is there any changes in configuration except changing the Events name.

Regards,

Moogambigai G R

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.