The Adaptavist Group LogoDocumentation

Script Variables

Migrating from ScriptRunner for Jira Server/DC to Cloud? Check out our ScriptRunner Migration to Cloud section.

How to use Script Variables

The variables are encrypted and stored within your ScriptRunner for 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.

Note: Please remember that a variable has a String value type, even if the value is a number. It is also worth noting that Script Variables are static and can only be set on the Script Variables page, so you cannot dynamically set the values of these via a script.

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

  1. 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.
  2. 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.
  3. Optional: Click Edit or Delete for your chosen scripted variable via the Actions ellipsis on this page to modify or delete as required.
  4. Enter a name in the Script Variable name field.
  5. Enter a password in the Script Variable value field.
  6. 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 access saved script variables by clicking the Script Context button in the editors for the Script Console, Script Listeners, Workflow Perform Actions, Scheduled Jobs, and Escalation Service.

Edit a Script Variable

  1. Navigate to ScriptRunner > Script Variables.
    A list of all script variables is shown.
  2. Click Edit on the Actions ellipsis of the script variable you wish to edit.
  3. Edit the fields as required.
    When all changes have been made, click Save. You can also click Revert to undo those changes.
  4. Click Save after all changes are complete.
    You can also click the Delete button and confirm when prompted.

Search documentation

Start typing to search the docs.