Good to know
Each Groovy script has to be whitelisted. To add Groovy scripts to the allowlist:
- Go to Administration > Manage apps > Assets Allowlist.
- Select Edit settings.
- Enter the filename and the full path to the script like in the example below:
4. Select Save.
Ensure that the directory and the subdirectories where your Groovy script is located are readable by all users and executable by the user running Jira. For example:
=$ ls -al ~/Users/jira/jira-home/atlassian-jira-servicedesk-4.20.0/scripts total 8 drwxr-x--- 3 jira staff 96 Nov 24 21:47 . drwxr-xr-x 21 jira staff 672 Dec 1 15:48 .. -rw-r--r-- 1 jira staff 2421 Nov 24 21:47 Move Object to Archive.groovy
When adding a Groovy script, the Assets workflow functions has the following variables pre-defined, so you can use them in your scripts.
|issue||The issue to be transitioned.|
The original issue. You can check conditions, like if the assignee has changed by:
The current Jira user. You can check if the reporter is the current user by:
A log framework. You can log to
If you're looking for some inspiration and examples, see Groovy script examples.