Use case
Make sure that a release can only proceed once all work items assigned to the same fix version have been completed.
This can be useful for release approval or deployment transitions where you want to prevent a release from moving forward while unfinished work is still associated with it.
Before you start
Make sure that:
-
the work item used to manage the release has at least one Fix Version assigned
-
all work items that belong to the release use the same Fix Version
-
completed work items use a status that belongs to Jira's Done status category
Configuration
Use the following JWT expression in the Logical Validator:
count(
issuesFromJQL(
"fixVersion in (" + %{issue.fixVersions.id} + ") AND statusCategory != Done AND key != '" + %{issue.key} + "'")
) = 0
The expression searches for all work items assigned to the same Fix Version as the current work item that are not yet completed.
The current work item itself is excluded from the search.
The validation succeeds only if the JQL query returns no remaining work items.
Error message
For example:
The release cannot proceed while there are unresolved work items for the selected fix version.
How it works
The key advantage of using a JWT expression in this scenario is the ability to execute a dynamic JQL query as part of the validation.
Instead of validating only information available on the current work item, the validator can take the state of other work items in Jira into account.
This makes it possible to implement validation rules that depend on the overall state of a release, project, sprint, or any other set of work items that can be identified using JQL.
Related use cases
| Use case | Workflow function | Use case description |
|---|---|---|
| Block a transition based on the day of the week |
Block transitions on weekends or any other day of the week. This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator. |
|
| Check whether an attachment was added during the transition. |
Make sure that the current user has uploaded a attachment during the transition. This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator. |
|
| Check if an attachment was added recently |
Make sure that the current user has uploaded a attachment during a definite period of time. This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator. |
|
| Block a transition if some issues under an epic are not in a certain status |
Check whether an epic has all issues under it in a certain status. This is particularly important if you want to block an epic as long as work is still being done on related sub-tasks. This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator. |
|
| Block a transition based on issue links |
Evaluate issue links and hide transitions based on the outcome. This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator. |
|
| Validate worklogs |
Evaluate if a user has logged more than a certain amount of time in the latest worklog.
|
|
| Evaluate the Parent field |
Evaluate different values of the issue in the Parent Link field of the transitioned issue. This use case is valid for both conditions and validators . The only difference is that you can specify an additional error message when using a validator. |
|
| Validate an issue only if a comment is written during the transition |
Evaluate the comments and block transitions based on the outcome. This use case is only valid for validators as it involves making changes during a transition. An additional error message can be added. |
|
| Ensure all work for a release is completed |
Make sure that a release can only proceed once all work items assigned to the same fix version have been completed. This can be useful for release approval or deployment transitions where you want to prevent a release from moving forward while unfinished work is still associated with it. |
|
| Block a transition based on sprint information |
Make sure that an issue is not in an active sprint. This use case is valid for both conditions and validators . The only difference is that you can specify an additional error message when using a validator. |
|
| Prevent users from starting too many work items |
Prevent users from starting too many work items at the same time. Before a work item can be moved to In Progress, the validator checks how many other work items are already assigned to the same user and currently in the In Progress status category. This can help teams keep work-in-progress under control and encourage users to finish existing work before starting additional items. |
|
| Check parent issue type |
Check whether the parent of the current issue is of a certain issue type. This is particularly important if you want to reuse a workflow for multiple sub-task issue types but only want a transition to be available if the sub-task belongs to a certain user story or a bug. This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator. |