When configuring a workflow orchestration between two projects, it must be possible to progress an issue from one status to another status using a correct transition.

This transition can be triggered by calling the workflowHelper.transition method in the Create and/or Change processor.

# 
# When the remote issue has status 'closed', progress this issue to status closed
#
if (replica.status.name == "Closed") {
   workflowHelper.transition(issue, "Closed")
}

A more elaborate example where the local status is set to a specific status depending on the remote status

WhenThen
Remote status = 'Assigned to Supplier'Local status should be set to 'Open'
Remote status = 'Quoted'Local status should be set to 'Quoted'
Remote status != 'Assigned to Supplier' and != 'Quoted'Local status should be set to 'Processed'.
The resolution should either be set to 'Pending' if the remote
resolution is not set, else to 'Fixed' if the remote resolution is set 

 
if (replica.status.name == "Assigned to supplier" && issue.status.name != "Open" ) {
  // issue is assigned to supplier, so it should be opened
  workflowHelper.transition(issue, "autoopen")
} else if (replica.status.name == "Quoted" && issue.status.name != "Quoted" ) {
  // issue has been quoted on the remote side, so it needs to be moved into status quoted here also
  workflowHelper.transition(issue, "autoquote")
} else if (replica.status.name != "Assigned to supplier") {
  if (replica.resolution.name == "NULL") {
      log.info("Transitioning using 'autopending'")
      workflowHelper.transition(issue, "autopending") 
  } else {
      log.info("Transitioning using 'autoresolve'")
      workflowHelper.transition(issue, "autoresolve") 
  }
}


Notes

 

 

See also