This page describes how you can store advanced groovy scripts outside the Sync Rules processors.
This feature requires a good understanding of Groovy, the entities of the underlying issue tracker, and Exalate itself.
We offer training and professional services to deliver the solution you're looking for. Please contact sales@exalate.com for more information.
Introduction
Advanced synchronization scripts usually contain a huge number of code lines. Storing these scripts in the Sync Rules make it hard to maintain.
With a scripts-specific folder outside of the Sync Rules you can have your own scripts library. You can create your own advanced .groovy scripts and add them into the library. Then call the script from the library in the Sync Rules configuration. Exalate will start to pick external files.
External scripts library location
Jira Server: $JIRA_HOME/scripts
HP ALM/QC: opt/hpqcnode/data/scripts
Externalized scripts provide you an ability to configure a complex synchronization case with a reduced amount of code inside the Sync Rules.
It allows making changes to your Exalate configuration easier and version scripts whenever you need it. You can share/copy the Sync Rules between different Connections.
To get autocompletion for all the variables available in the script and the Jira API (such as com.atlassian.jira.component.ComponentAccessor), configure the IDE to use shared Maven configuration repository. This helps to improve your scripting experience with Exalate. You can also version your scripts with any major change using version control systems.
Externalized scripts functionality allows to include following files:
- sources
- groovy
- compiled .class
- packaged jar
- resources - plain text and binary resources
The scripts directory must have permissions to write and read directories/files.
Available external scripts
Exalate documentation includes a lot of example scripts containing approaches on how to implement various use cases. Please note that many of these scripts are used only for example purposes.
Below you can find a list of available external scripts.
Script / Usage article link Purpose JIRA SERVER JIRA DATA CENTER JIRA SERVER JIRA DATA CENTER ExalateEventListener.groovy DEPRECATED This approach has been deprecated. Use these methods instead: Updating a local custom field with a remote issue key in Exalate for Jira on-premise Updating a local custom field with a remote issue key in Exalate for Jira Cloud Syncing a comment with a remote issue key in Exalate for Jira on-premise Syncing a comment with a remote issue key in Exalate for Jira Cloud The script allows subscribing to Exalate Jira issue events: JIRA SERVER JIRA DATA CENTER Status.groovy (Server) Status.groovy (Cloud) JIRA SERVER JIRA DATA CENTER JIRA CLOUD JIRA SERVER JIRA DATA CENTER JIRA SERVER JIRA DATA CENTER JIRA SERVER JIRA DATA CENTER JIRA SERVER JIRA DATA CENTER Epic.groovy (Server) Epic.groovy (Cloud) JIRA SERVER JIRA DATA CENTER JIRA CLOUD JIRA SERVER JIRA DATA CENTER JIRA CLOUD SimpleSprintSync.groovy DEPRECATED Use how to synchronize sprints on Jira to configure sprints synchronization. JIRA SERVER JIRA DATA CENTERSupported Platforms Used to synchronize Versions Components.groovy Used to synchronize Components Used to synchronize Statuses IssueLinks.groovy Used to synchronize issue links Move.groovy Used to move issues automatically CustomFieldSync.groovy Used to synchronize custom fields SubTask.groovy Used to synchronize Sub Tasks Used to synchronize Epics on Jira Server/ Jira Data Center TempoWorkLogSync Used to synchronize Tempo Worklogs. Used to synchronize Sprint field
What's next
- Check an example of how you can add an external script
- Set up advanced scripting environment
- Externalize your existing scripts