How to Add an External Script in Jira On-premise

    This article shows how to add an external script to your server.

    External scripts are groovy scripts/classes which can be reused in the connections. For instance, by deploying the following class, you are able to use the code in the incoming and outgoing processors:

    class HelloWorld {
          public static void greetings() {
                 return "Hello World"
          }
    
    }

    This can be used by adding the following script in the processor:

    ...
    issue.description = HelloWorld.greetings()
    ...

    Which sets the description to 'Hello World'.

    How to Deploy

    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.