This feature is available for the Jira server deployment option only. We plan to add it to the Cloud version in the near future.
Validators check that any input available to the transition (such as user-supplied input) is valid before the transition is performed. If a transition's validator 'fails', the transition's post functions will not be executed and the issue will not progress to the destination step of the transition.
You can use Power Scripts™ for Jira and SIL™ to define a large set of validators beside the default validators offered by Jira, by just adding a (k) SIL™ Validator to a transition and publishing the workflow, as described .
Below are just a few common examples:
Power Scripts™ for Jira (server)
A validator that forces users to enter a comment during a transition, otherwise displaying a customized error message:
Field has single value
A SIL™ validator for checking if a multi-valued field does not contain more than one value during a transition:
A SIL™ validator which ensures that the current issue's parent issue is in one of the specified Statuses:
Validation based on regular expression
A SIL™ validator which checks if a text field matches a regular expression (eg for a social number):
Force a custom field to be required if another field was set to a certain value
A SIL™ validator which makes custom field Product with id customfield_10200 required in the resolve screen only if the resolution was set to Fixed:
In a similar way, you can make any custom field required based on another custom field value:
In the above example we assume that the field with id customfield_10100 is a select list with options Yes and No, and when Yes option is selected, field Address with id customfield_10200 should be required.
Ensure that the issue has at least one attachment
A SIL™ validator which checks if an issue has any file attached during a transaction:
Validation on linked issues
Blocking Start Progress transition whenever current issue has a link of type Blocks with an issue in a status different from Resolved and Closed:
Forbidding issue links of types Blocks and Cloners with issues of type Bug:
Validation on non-linked issue
Preventing a transition from being executed if the rest of issues in the project aren't closed:
Validation based on mathematical expression
A SIL™ validator which checks if a numeric custom field is greater than or equal to 0:
The sign routine determines the sign of a number. It returns 1 if the number is positive, zero (0) if the number is 0, and -1 if the number is negative.
More useful mathematical routines can be found in the Math routines section.
Validation based on date-time expression
A SIL™ validator which checks if due date is before current date:
More useful date routines can be found in the Date Routines section.
Compare two parsed texts
A SIL™ validator which checks if description contains summary:
Users in a field are/aren't in a project role
A SIL™ validator which checks if users selected in a multi user picker custom field are in a given project role:
A custom field is/isn't initialized
A SIL™ validator which checks if a custom field is initialized during transaction:
Check user property
A SIL™ validator which checks if a user property has a certain value: