JIRA SERVER STARTING FROM 4.5.1

This article shows how to sync statuses with the Exalate external script. 

Introduction

This page describes how to synchronize issue statuses between two JIRA Instances bi-directionally.


JIRA requires that status is updated by progressing an issue through the different workflow steps.  This can be done in different ways: 

A third approach is the one explained in this document, where the processor tries to find the shortest path to the appropriate status automatically, based on the mapping set in the script. 

Configuration

Let's consider you already have the Connection configured between two JIRA Instances.

Now you need to configure status synchronization: 

  1. Create files from the Exalate public repository

    We store external scripts for Jira Server in a public repository.  Copy the code from the repositories below and create .groovy files. You must keep the file name as below.

  2. Upload the files to the $JIRA_HOME/scripts directory

  3. Configure Sync Rules with the scripts provided below:

    Add the snippets below to the end of the Sync Rules.

    Source side 

    Outgoing sync

    Status.send()

    Destination side

    Incoming sync


    1. If statuses are the same on both sides, use this code:

      Status.receive()

    2. If the statuses are different, use this code with your status mapping

      Status.receive(useRemoteStatusByDefault = true, workflowMapping = [
       "Remote Status A" : "Local Status A",
       "Remote Status B" : "Local Status B",
       "Remote Status C" : "Local Status C",
       ], resolutionMapping = [:])

Status.receive  has the following parameters: 

//default parameters 
Status.receive(useRemoteStatusByDefault = true, workflowMapping = [:], resolutionMapping = [:])

  • useRemoteStatusByDefault = true 
    Use the remote status by default. 

    Status.receive(useRemoteStatusByDefault = true) // Exalate will look for a local status with the same name as the incoming status
     or
    Status.receive(useRemoteStatusByDefault = false)

  • workflowMapping = [:]
    Defines the status mapping as on the example below

    Status.receive(workflowMapping = [
     "Remote Status A" : "Local Status A",
     "Remote Status B" : "Local Status B",
     "Remote Status C" : "Local Status C",
     ])

  • resolutionMapping = [:]
    Defines resolution mapping as on the example below

    Status.receive(resolutionMapping = [
    "Remote Resolution A": "Local Resolution A"
    ])

See Also