How to Work with External Scripts in Jira On-premise

    This page describes how you can store advanced groovy scripts outside the Sync Rules processors.

    Note: 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 makes 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 to the library. Then call the script from the library in the Sync Rules configuration. Exalate starts to pick external files.

    Externalized scripts provide you the 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 auto-completion for all the variables available in the script and the Jira API (such as com.atlassian.jira.component.ComponentAccessor), configure the IDE to use the 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 script directory must have permission to write and read directories/files.

    Where to Set Up Scripts?

    Custom scripts can only be deployed on Jira Server/Datacenter and nodes which are deployed through the docker deployment approach.

    Platform location
    Jira Server

    <jira-home>/scripts

    Jira Datacenter

    <jira-shared-home>/scripts

    Docker based

    /opt/<nodename>/data/scripts

    There could be one of the following values instead of <nodename>:

    • snownode for Exalate for ServiceNow.

    • adnode for Exalate for Azure DevOps.

    • hpqcnode for Exalate for HP ALM/QC.

    Jira Cloud

    Jira Cloud, just as any other cloud node, supports a set of specific scripts. Custom scripts cannot be deployed in this environment.

    Check out List of external scripts for Jira Cloud for more information.

    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 / Article link Used to Supported platforms
    Versions.groovy Sync versions

    JIRA SERVER

    JIRA DATA CENTER

    Components.groovy Sync components

    JIRA SERVER

    JIRA DATA CENTER

    ExalateEventListener.groovy DEPRECATED

    Subscribe to Exalate Jira issue events:

    • exalated
    • unexalated
    • updated
    • deleted

    JIRA SERVER

    JIRA DATA CENTER

    Status.groovy Sync statuses

    JIRA SERVER

    JIRA DATA CENTER

    IssueLinks.groovy Sync issue links

    JIRA SERVER

    JIRA DATA CENTER

    Move.groovy Move issues automatically

    JIRA SERVER

    JIRA DATA CENTER

    CustomFieldSync.groovy Sync custom fields

    JIRA SERVER

    JIRA DATA CENTER

    SubTask.groovy Sync sub tasks

    JIRA SERVER

    JIRA DATA CENTER

    Epic.groovy Sync epics on Jira Server / Jira Data Center

    JIRA SERVER

    JIRA DATA CENTER

    TempoWorkLogSync Sync Tempo worklogs

    JIRA SERVER

    JIRA DATA CENTER

    SimpleSprintSync.groovy DEPRECATED

    Check out How to sync sprints in Jira on-premise for relevant info on syncing sprints.

    Sync sprints

    JIRA SERVER

    JIRA DATA CENTER