Example: Validation on sibling sub-tasks depending on issue type and status
I have one Issue with two sub-tasks, say sub-task A (of issue type A) and sub-task B (of issue type B).
I would like to add a validation on a transition of sub-task A that allows that transition to be executed only if the the value of the Status Field of sub-task B is for example "Open" OR "In Progress" OR "Reopened". For any other value of the sub-task B's Status Field, the transition of sub-task A will be forbidden.
That validation can be implemented with Jira Workflow Toolbox 2.1.20 or higher, using Boolean validator with math, date-time or text-string terms. I will show how to implement two variants of the validation. You can choose the one that better fits your use case:
I suppose that parent issue has at least one sub-task of type "issue type B", and we want to validate that at least one of them is in the status "Open", "In Progress" or "Reopened". To implement that validation we use the validator with the following configuration:
Boolean expression used is: count(filterByStatus(filterByIssueType(subtasks(%{00041}), "Issue Type B"), "Open, In Progress, Reopened")) > 0
Note that:
- %{00041} is code for virtual field "Parent's issue key"
- "Issue type B" is the name of a issue type
Once configured, the transition will look like this:
Other variation of the usage example
I suppose that parent issue may have or may not have sub-tasks of type "Issue type B". We want to validate that every sub-task of type "Issue type B" is in the status "Open", "In Progress" or "Reopened".
To implement that validation we use Boolean validator with math, date-time or text-string terms with the following configuration:
Boolean expression used is: count(filterByStatus(filterByIssueType(subtasks(%{00041}), "Issue Type B"), "Open, In Progress, Reopened")) = count(filterByIssueType(subtasks(%{00041}), "Issue Type B"))
Note that:
- %{00041} is code for virtual field "Parent's issue key"
- "Issue type B" is the name of a issue type
Once configured, the transition will look like this:
Other examples of that function
- Block a transition until all sub-tasks have certains fields populated
- Block an epic's transition depending on linked issues status and due date
- Block or hide a transition for an issue depending on its issue links
- Block or unblock a transition after an issue rested a specific time in a status
- Block transition until all sub-tasks are in a specific status category
- Close parent issue when all sub-tasks are closed
- Enforce a field (Select List) to be set when another field (Radio Button) has a certain value (works with any kind of field type)
- Ensure that all issues linked with a certain issue link type have "Due Date" field set
- If field A is populated then, field B must also be populated
- Limit issue creation per role and issue type
- Limit the number of hours a user can log per day
- Limit valid dates for work logs
- Make "Time Spent" field required when there is no time logged in the issue
- Make a custom field mandatory when priority is "Critical" or "Blocker" and issue type is "Incident"
- Make attachment mandatory depending on the value of certain custom field
- Make different fields mandatory depending on the value of a Select List custom field
- Make linked issues, sub-tasks and JQL selected issues progress through its workflows
- Make parent issue progress through its workflow
- Prevent issue creation if another issue with same field value already exists
- Reject duplicated file names in attachments
- Require at least one sub-task in status "Resolved" or "Closed" when "Testing required" is selected in Check-Box custom field
- Require issue link when resolving as duplicate
- Restrict parent issue from closing if it has sub-tasks that were created during a given parent issue status
- Restrict sub-task type creation depending on parent issue status
- Restrict sub-task type creation depending on parent issue type
- Set a condition in a global transition which only applies in a certain status
- Validate a custom field "Story Points" has been given a value in Fibonacci sequence
- Validate compatible values selection among dependent custom fields
- Validate only issue links created in transition screen
- Validate that multi-user picker custom field A does not contain any user in multi-user picker custom field B
- Validation and condition based on time expressions
- Validation based on the value of a date type project property
- Validation on issue attachments
- Validation on MIME types of issue attachments
- Validation on sibling sub-tasks depending on issue type and status
- Validation on the value of a Cascading Select field