Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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.

Table value validation

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:

  1. Install Scriptrunner by Adaptavist.

  2. Access the workflow editor.

  3. Choose the relevant transition and click on Validators, then Add Validator.

  4. 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".

  5. Assign a name to the validator.

  6. 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.

  7. 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.

Column value validation

In the example below, the Jira Expression validates if the transition’s sum of field values is 50 or more.

(issue.properties['stjc-field-817']?.values ? issue.properties['stjc-field-22']?.values?.reduce((a, b) => a + Number(b.get("2974")) ,0) : 0 ) >= 50, where

22 is the Table ID;

2974 is a table column ID.

  • No labels