This article shows how to move issues automatically with the External scripts library.
This script handles the situation when you move issues from one workflow to another workflow on the source system.
|Source side||Destination side|
1. Upload the File with the External Script
You need to upload the Move.groovy file into the scripts directory
External scripts library location
Jira Server: $JIRA_HOME/scripts
2. Call the Script from the Sync Rules
Once all external .groovy files have been uploaded to the proper directory, you need to call the script from the Sync Rules.
Every .groovy file includes comments with a detailed explanation on how to use it. Please check the file comments.
Add the snippet below to the new line in the end of the data filter
Add the snippet below to the new line in the end of the change processor
Move Issues automatically according to the Specified Mapping
The method helps to move issues automatically in case the source issue has been moved to another project or the issue type has been changed on the source side.
Move Issue with Identical Workflows for all Issue Types
If the workflows are identical for all issue types, you don't need to specify the status mapping. But you still need to specify project and issue type mappings if the projects and issue types are different.
Move Issue with Different Workflows for all Issue Types
moveStatusMapping - defines, the status of the issue moved to another workflow.
If an issue which is under sync is moved from LocalWorkFlow1 to LocalWorkFlow2 and the current status is OPEN, set the status TO DO.
Example: [...,"LocalWorkFlow1":[...,"LocalWorkFlow2":[...,"OPEN":"TO DO",...],...],...]
Incoming sync for existing issues(change processor)
Sync Issues Automatically Using Exalate API in Jira On-premise
This article shows how to start issue synchronization automatically with the help of Exalate API.
Sync an issue according to the specified issue key
def exaCl = com.atlassian.jira.component.ComponentAccessor .pluginAccessor .getEnabledPlugin("com.exalate.jiranode") .getClassLoader() def exaSyncServiceClass = exaCl.loadClass( "com.exalate.api.trigger.ISyncInitiationService" ) def syncService = com.atlassian.jira.component.ComponentAccessor.getOSGiComponentInstanceOfType( exaSyncServiceClass ) syncService.pair( "PROJ-23", // specify the issue key you want "ConnectionTest" // set the relevant connection name )