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

  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.

For help navigating to ScriptRunner workflow functions, follow the steps to navigate to workflow functions.

Edit Validator

  1. Select the transition the validator is on.

  2. Click Validators. A list of all validators on the selected transition is shown.

  3. To edit an existing validator, click the Pencil.

  4. Edit the validator and click Update.