This article shows how to use Exalate event listener external script which we've included in the External scripts library.
The script allows subscribing to Exalate Jira issue events:
Delete original issue once it's synced
This is a common case when you move issues from one instance to another. Once the issue has been synchronized(moved) no need to keep the original issue.
Delete an issue in the target system when it's deleted in the original
Exalate works such that if you delete an issue that is under sync from the source side, a twin issue remains on the remote side. The twin issue sync status changes to Remote issue removed.
With the help of ExalateEventListener.groovy you can remove both: the source issue which is under sync and then the twin issue on the remote side.
Include of Exalate actions under the History tab in Jira
Exalate can notify issue tracker that the event has been synchronized. Based on this notification ExalateEventListener allows to include Exalate actions into history tab.
Move issue case: change the source issue status and stop synchronization
Another common case is when you use Exalate to move issues from one instance to another. Once the source issue is synchronized change its status to Done and stop the synchronization.
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 firstname.lastname@example.org for more information.
Example snippet 1
- Check from what instance an issue has been originally synced
- If the source instance is X add the issue link "moved to [destination side issue link]"
- Change source issue status to done
- Stop synchronization on the source side
Example snippet 2
- Sync issue from the source instance
- Set the remove issue key into a custom field on the source side
1. Create the file 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 file with the external script
You need to upload the .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.