On this page
...
Info |
---|
This page describes how to block workflow transition if selected checklist items are not completed. As a result selected checklist items must be completed to move the issue to another status (e.g. Done or Resolved). At the same time, other checklist items can stay not completed and the transition will be still enabled. |
Info |
---|
If you want to enable transition only when all the items are completed then please follow the guide Block workflow transition if checklist is not complete. |
...
- Navigate to "Project settings > Workflows" or "Jira settings > Issues > Workflows".
- Edit the selected workflow (click "pen" icon or "Edit" link)
- Select Diagram view (1) and next select the transition (2) that you want to block, e.g. Done. After that press Validators link (3):
- Press "Add Validator" link:
- Select "Regular Expression Check" and press "Add" button:
Select "Checklist Text" field in the dropdown, and paste following value in "Regular expression" field, next press "Add" button:
Code Block (?ms).*^\*\s+\[(x|done|skipped)\]\s+first item.*
Below is an example of a regular expression that checks for two items:Code Block theme Confluence (?ms).*^\*\s+\[(x|done|skipped)\]\s+first item.*^\*\s+\[(x|done|skipped)\]\s+second item.*
- Confirm that validator is available on the list and press "Publish Draft" link
- Confirm that validator (blocking issue transition) works fine:
- Open issue in a project that uses modified workflow
- Add checklist items ("first item" and "second item")
Press transition button and observe error message displayed by Jira if "first item" is unchecked
Info |
---|
It is not possible to specify a custom error message for a blocked transition. The described solution relies on a built-in JIRA validator that comes with its own message. |
Info |
---|
The solution presented above is based on the checklist item text (please spot "first item" text in the regular expression). It means that for single item checklist items order is not important and the solution works well if items are reordered and "second item" is on the first position. However, if your regular expression checks for multiple items then they have to occur in the same order as in checklist. |
...
Info | ||
---|---|---|
| ||
Due to to a bug in Jira regular expression validator will throw an exception if used on an empty custom field (such as Checklist Text). This means that the regular expression above will require not only that there are no items with status "open", but also that the checklist has items at all. Please click on "This affects my team" on the bug's page and, optionally, comment to help make Atlassian fix it faster. |
Example 6 - block transition if no items are checked
...