A script validator is a powered-up version of a standard Jira validator. Instead of using one of the basic validators that you find in Jira, you can run a script to validate your issue. If the script returns false the script does not transition until all errors are resolved, for example, filling in the required fields. Validators allow administrators to determine what error message is displayed to the user. So, a scripted condition gives you more options to control this part of the workflow.

ScriptRunner for Jira Cloud provides workflow validators using the Jira Expression Framework. It is not possible to use the REST API.

There are several ways to enhance your workflow using script validators, including:

  • Require a Fix Version if the resolution value is set to Fixed.

  • Require a comment when the resolution is Wont Fix.

  • Ensure all at least one sub-task is In Progress if the resolution of the parent issue changes to In Progress.

Remember, a validator checks to see if the user can transition an issue, they don’t prevent the next transition button from appearing (that is a script condition).

Add Validator

For help navigating to ScriptRunner workflow functions, follow the steps in the Example Workflow Extension

  1. Select the transition you wish to add the validator to.

  2. Click Validators→Add Validator.

  3. Select the ScriptRunner Script option then Add.

  4. Enter the Name of ScriptRunner Script Validator.

  5. In the ScriptRunner Script Validator field, enter the script validator expression. This script validator must be written as a Jira expression.

  6. Type an error message to show when the validator fails in Message to Show when Validation Fails.

Edit Validator

  1. Navigate to ScriptRunner → Workflows. All existing workflows are displayed as default.
  2. Select Validator from the Type drop down list. You will now see a refined list displayed.
  3. Click the Actions ellipsis for your preferred workflow and select Edit.
  4. Edit the validator fields and click Save.