JIRA CLOUD JIRA SERVER

Disclaimer

 To be able to develop advanced synchronization scripts you require a development background and a good understanding of Groovy and the entities of the underlying issue tracker and Exalate itself. 

In case of need, we can provide training and professional services to deliver the solution you're looking for.  Please contact sales@exalate.com for more information.

This article show how to sync statuses using external scripts library.

Scripts work for Jira Software 7.4.0 and higher.

 

This page describes how to synchronize an agile project between JIRA Instances using external scripts library. The guide includes scripts for both JIRA Server and JIRA Cloud instances.

It means that all agile information within the project will be synchronized. 

Agile information includes sprints, epics, versions, ranking, issues with all data including issue statuses, estimates, change history, issue links, sub-tasks, typical issue custom fields, etc.

Pre-requisites: 

  • Source Instance (Jira Server or Jira Cloud)
  • Destination Instance (Jira Server  or Jira Cloud)
  • A project with data on the source side
  • Connection configured between Jira Instances.
  • Global transitions on the destination side
    • To ensure that the status on the destination side is set correctly, there should be a global transition to each status in all workflows.
      Global transitions allow any status in a workflow to transition to a particular status.  More information on this topic can be found on the Atlassian documentation

Description:

We have one Jira instance, let's call it source side and another Jira instance which is a destination side. It doesn't matter which one is the source and which one is the destination since the project sync is bidirectional. The source side agile project needs to be synced to the destination Jira instance. The destination side has a project to receive data from the source Instance. 

Limitations and caveats

  • Sprint start/completion date is not synchronized
  • Projects need to be configured in a similar way - ie custom fields should have the same name, duplicate custom field names to be avoided 
  • Boards need to exist beforehand

Configuration

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

Now you need to configure Sync Rules to sync agile information.

Scripts for the Cloud JIRA are different from the Server JIRA scripts.

Please be sure to copy appropriate scripts.

Jira Server

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 names as below.



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


$JIRA_HOME/scripts directory is located on the server, where you have your Jira instance installed.

If you don't have scripts directory you should create it.



3. Configure Sync Rules with the scripts provided below:

Add the code from the repository accordingly into the Sync Rules

The Create and Change processor have SETTINGS section at the top. You need to configure these settings.

Please replace demo data with your own to sync Agile projects correctly.

Example of the script settings section from the Create Processor for Jira Server.

// SETTINGS
def projectMapping = [
        "REMOTEPROJ":"LOCALPROJ"
]
def issueTypeMapping = [
        "Remote Issue Type 1": "Local Issue Type 1"
] as Map<String, String>

def priorityMapping = [
        "Remote Priority 1": "Local Priority 1"
] as Map<String, String>

// enter the corresponding statuses of the source and destination issue
final def workflowMapping = [
        "Source Status A" : "Dest Status A",
        "Source Status B" : "Dest Status B",
        "Source Status C" : "Dest Status C",
] as Map<String, String>
// END: SETTINGS

Example of the script settings section from the Change Processor for Jira Server.

// SETTINGS
def priorityMapping = [
        "Remote Priority 1": "Local Priority 1"
] as Map<String, String>


// enter the corresponding statuses of the source and destination issue
final def workflowMapping = [
        "Source Status A" : "Dest Status A",
        "Source Status B" : "Dest Status B",
        "Source Status C" : "Dest Status C",
] as Map<String, String>

// END: SETTINGS

 

Jira Cloud

External scripts for Exalate app for Jira Cloud are deployed by Exalate team. You don't need to copy files manually.

Configure Sync Rules with the scripts provided below

Add the code from the repository accordingly into the Sync Rules

The Incoming sync (Create /Change processor) have SETTINGS section at the top. You need to configure these settings.

Please replace demo data with your own to sync Agile projects correctly.

Example of the script settings section from the Create Processor for Jira Cloud.

// SETTINGS
def projectMapping = [
        "Remote Project 1": "Local Project 1",
        "Remote Project 2": "Local Project 2"
]

def issueTypeMapping = [
        "Remote Issue Type 1": "Local Issue Type 1"
] as Map<String, String>

def priorityMapping = [
        "Remote Priority 1": "Local Priority 1"
] as Map<String, String>

// enter the corresponding statuses of the source and destination issue
final def workflowMapping = [
        "Remote Status A" : "Local Status A",
        "Remote Status B" : "Local Status B",
        "Remote Status C" : "Local Status C"
] as Map<String, String>
// END: SETTINGS

Example of the script settings section from the Change Processor for Jira Cloud.

// SETTINGS
def priorityMapping = [
        "Remote Priority 1": "Local Priority 1"
] as Map<String, String>


// enter the corresponding statuses of the source and destination issue
final def workflowMapping = [
        "Source Status A" : "Dest Status A",
        "Source Status B" : "Dest Status B",
        "Source Status C" : "Dest Status C",
] as Map<String, String>
// END: SETTINGS



Validation

Validate the synchronization by manipulating data on the source side and checking if this is reflected on the destination side

  1. Ensure that the Exalate operation is available on the server side.  This allows triggering a synchronization on a single issue
  2. Trigger a synchronization for an Epic, a story in an Epic, a subtask in a story
  3. Move a story from one sprint to another
  4. Create a sprint

 

Bulk Exalate

Ensure that all the issues are synchronized to the cloud side

Create a Trigger on the sending side:

In the Exalate admin menu, access the triggers and create a new trigger. Include all issues in your project to be synchronized using the previously created Connection. The Connection towards the receiving instance (Cloud Jira). Activate the trigger.


Use Bulk Exalate to synchronize multiple issues at a time.



Exalate is running through all the issues and sending out all the information from the Server instance to the Cloud instance. After a while, all issues will be showing up in the same configuration as on the Server instance.

 

If you us the project sync only for migration purposes, you should stop synchronizing issues as soon as the synchronization process is finished.

 

Congratulations! Now you know how to configure an agile project sync using Exalate application.

Note

 If you want to use this script, but you are missing a functionality or would like to get it adapted to your use case, send us a mail to support@exalate.com