Introduction

Assume you want to setup a connection between a software vendor and one of their customers. The challenge is to create a unified workflow so that each party can work on their own tracker, but that the issue is handled by both.  

This example shows how you can construct your relations so that the right transition is selected. Also check 'Unified workflow using global transitions' for another approach where the transitions in both workflows are global.

Disjoint workflows

The scenario is as follows. Two issue trackers - 'blue' and 'red'  - blue is being used by the customer, red by the software vendor. The blue workflow has been setup to reflect the remote issue status, while the red workflow is a simple three stage issue workflow.

Blue

Red

 

The unified workflow main path is depicted below:

  • Customer raises an issue and exalates it to the software vendor.
  • A new issue is created automatically.
  • The software vendor starts working on the issue.
  • The customer issue is automatically progressed to status 'Remote progress'.
  • The software vendor completes the implementation, and progresses the issue to 'Resolved'.
  • The customer issue changes status automatically to 'Remote resolved'.
  • The customer reviews the implementation and confirms by closing the issue.
  • The software vendor issue is automatically closed.

sequence

Configuration

Blue issue tracker

Outgoing sync

Data filter

replica.key           = issue.key
replica.assignee      = issue.assignee  
replica.reporter      = issue.reporter
replica.summary       = issue.summary
replica.description   = issue.description
replica.comments      = issue.comments
replica.resolution    = issue.resolution
replica.status        = issue.status
replica.project       = issue.project
replica.priority	  = issue.priority
replica.attachments   = issue.attachments

Incoming sync

Create processor

issue.project = nodeHelper.getProject("BUGSRUS")
issue.issueType =nodeHelper.getIssueType("Task")
issue.summary		= replica.summary
issue.description   = replica.description
issue.comments += replica.addedComments
issue.attachments += replica.addedAttachments


Change processor

issue.summary		= replica.summary
issue.description   = replica.description
issue.comments += replica.addedComments
issue.attachments += replica.addedAttachments
if (replica.status.id == "3") {
	log.info("Transitioning using 'autoRemoteStart'")
	workflowHelper.transition( issue, "autoRemoteStart")
}
if (current.status.id == "5") {
	log.info("Transitioning using 'autoRemoteResolve'")
	workflowHelper.transition( issue, "autoRemoteResolve")
}


Red issue tracker

Outgoing sync

Data Filter

replica.key           = issue.key
replica.assignee      = issue.assignee  
replica.reporter      = issue.reporter
replica.summary       = issue.summary
replica.description   = issue.description
replica.comments      = issue.comments
replica.resolution    = issue.resolution
replica.status        = issue.status
replica.project       = issue.project
replica.attachments   = issue.attachments
 

Incoming sync

Create processor 

issue.project = nodeHelper.getProject("ACME")
issue.issueType =nodeHelper.getIssueType("Task")
issue.summary		= replica.summary
issue.description   = replica.description
issue.comments += replica.addedComments
issue.attachments += replica.addedAttachments

// prepare the different customfield objects
issue.customFields."Remote Reporter" = nodeHelper.getCustomField("Remote Reporter")
issue.customFields."Remote Key" = nodeHelper.getCustomField("Remote Key")
issue.customFields."Remote Assignee" = nodeHelper.getCustomField("Remote Assignee")
issue.customFields."Remote Status" = nodeHelper.getCustomField("Remote Status")
issue.customFields."Remote Reporter".value = replica.reporter.displayName + " (" + replica.reporter.email + ")"
if (replica.assignee) {
   issue.customFields."Remote Assignee".value = replica.assignee.displayName + " (" + replica.assignee.email + ")"  
}
issue.customFields."Remote Status".value   = replica.status.name
issue.customFields."Remote Key".value      = replica.key

Change processor

issue.summary		= replica.summary
issue.description   = replica.description
issue.comments += replica.addedComments
issue.attachments += replica.addedAttachments
// prepare the different customfield objects
issue.customFields."Remote Reporter" = nodeHelper.getCustomField("Remote Reporter")
issue.customFields."Remote Key" = nodeHelper.getCustomField("Remote Key")
issue.customFields."Remote Assignee" = nodeHelper.getCustomField("Remote Assignee")
issue.customFields."Remote Status" = nodeHelper.getCustomField("Remote Status")

issue.customFields."Remote Reporter".value = current.reporter.displayName + " (" + current.reporter.email + ")"
if (current.assignee) {
   issue.customFields."Remote Assignee".value = current.assignee.displayName + " (" + current.assignee.email + ")"
}

issue.customFields."Remote Status".value   = current.status.name
issue.customFields."Remote Key".value      = current.key
// if the remote status is done, close the local
if (current.status.id == "10000") {
	workflowHelper.transition( issue, "autoClose")  
}


See also

How to hide a transition