JIRA CLOUD

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.

Introduction

This page shows how to synchronize issue statuses with global transitions in Jira Cloud. You will need to map workflows between two JIRA Instances.Jira requires status update by progressing an issue through different workflow steps. You can do this by automatic progressing to the right status according to the status mapping. You can configure it with the help of external scripts library and advanced groovy scripting. Exalate can find the shortest path to the appropriate status automatically, based on the specified mapping, set in the script.


In case the transitions are not global please refer to the following article: Status synchronization on Jira cloud when transitions are not global


Configuration

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

Now you need to configure status synchronization:

Configure Sync Rules with the scripts provided below:

Add the snippets below to the new line in the end of the existing scripts.



Source side
Outgoing sync(Data Filter)

StatusSync.sendStatus(replica, issue)

Destination side

Incoming sync for new issues(Create Processor)

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

return CreateIssue.create(
                replica,
                issue,
                connection,
                issueBeforeScript,
                traces,
                blobMetadataList,
                httpClient,
                syncRequest) {
StatusSync.receiveStatus(
    			true, 
    			[:],
				[:],
				[:],
				[:],
   				replica,
   				issue,
    			nodeHelper,
				httpClient
	)
}
If the statuses are different, use this code with your status mapping
return CreateIssue.create(
                replica,
                issue,
                connection,
                issueBeforeScript,
                traces,
                blobMetadataList,
                httpClient,
                syncRequest) {
StatusSync.receiveStatus(
    [
        "Source Status A" : "Dest Status A",
        "Source Status B" : "Dest Status B",
        "Source Status C" : "Dest Status C",
    ],
    replica,
    issue,
    nodeHelper,
httpClient
)
}

Incoming sync for new issues(Change Processor)

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

StatusSync.receiveStatus(
    true, 
    [:],
	[:],
[:],
[:],
    replica,
    issue,
    nodeHelper,
	httpClient
)
If the statuses are different, use this code with your status mapping
StatusSync.receiveStatus(
    [
        "Source Status A" : "Dest Status A",
        "Source Status B" : "Dest Status B",
        "Source Status C" : "Dest Status C",
    ],
    replica,
    issue,
    nodeHelper,
	httpClient
)


See also