Script Variables
What are Script Variables?
You can use Script Variables to specify variables that can be inserted into your scripts (Script Console, Script Listeners, Workflow Post Functions, Scheduled Jobs, Escalation Service).
How to use Script Variables
The variables are encrypted and stored in your Jira Cloud instance. You can use them to share common variables between your scripts, or to store sensitive data such as passwords that require encryption rather than hard-coding them directly in scripts.
Naming Convention
Variable names must follow these rules:
start with a letter
only capital letters are allowed
only digits and underscore character (_) are allowed
Limitations
Length limits for variables include:
name is 32 characters
value is 3000 characters
Note that clicking the show password icon of script variables that are >50 characters opens a popup screen for easy viewing.
Create a Script Variable
- Navigate to ScriptRunner → Script Variables.
Depending on whether or not you have already created script variables, you are presented with either a landing screen or a list of previously created script variables. - Click Create Script Variables from the initial landing screen if none have been previously created.
OR
Click Create Script Variables from the previously created list. - (Optional) Click Edit or Delete for your chosen scripted variable via the Actions ellipsis on this page to modify or delete as required.
- Enter a name in the Script Variable name field.
- Enter a password in the Script Variable value field.
Click Save or Cancel. Once saved, you will see a confirmation message display and you are automatically redirected to the Script Variables page. You can click the eye icon next to the Password to make it visible or not visible, as required.
Edit a Script Variable
Navigate to ScriptRunner → Script Variables. A list of all script variables is shown.
Click Edit on the Actions ellipsis of the script variable you wish to edit.
Edit the fields as required. When all changes have been made, click Save. You can also click Revert to undo those changes.
- Click Save after all changes are complete. You can also click the Delete button and confirm when prompted.