Using a STAGIL table or checklist as a validator can be easily achieved through a Scriptrunner Validator script utilizing a Jira Expression as a condition.
Let's take a look at an example where we create a validation that restricts users from transitioning an issue if the STAGIL table has no values.
Here are the steps to follow:
Install Scriptrunner by Adaptavist.
Access the workflow editor.
Choose the relevant transition and click on Validators, then Add Validator.
Opt for the ScriptrunnerScript option with the description "Add a ScriptRunner Script Validator that evaluates a Jira Expression to determine whether data input to the transition is valid".
Assign a name to the validator.
Compose a custom message that users will see when they attempt to transition the table, but the table has no values and does not fulfil the Jira Expression requirement.
The Script Validator field is where you can input the Jira Expression or validation condition.
issue.properties['stjc-field-22'] != null
, where
22
is the table ID.