Features used to implement the example
- Condition and validation on sub-tasks
- Boolean condition and validator with math. date-time or text-string terms
- Copy parsed text to a field
Example: Close parent issue when all sub-tasks are closed
We want to automatically close parent issue when the all subtasks has been closed. We are going to describe two different solutions to implement this behavior
This solution consist on a validator in parent's workflow, and a post-function in sub-tasks workflow:
A validation in parent issue workflow to prevent parent issue from being closed manually whenever there still are open sub-tasks. To do it we use Condition and validation on sub-tasks in transition "Done" or "Close Issue" on parent's workflow with the following configuration:
Once configured, transition "Close Issue" in parent's workflow will look like this:
Alternatively, we can use Boolean condition and validator with math. date-time or text-string terms with the following boolean expression:
count(subtasks()) = count(filterByStatus(subtasks(), "Closed, Done"))
We add a post-function in sub-task's workflow for trying to close parent issue each time a sub-task is closed. To implement it we use post-function Copy parsed text to a field in transition "Done" or "Close Issue" on sub-task's workflow with the following configuration:
Once configured, transition "Done" or "Close Issue" in sub-task's workflow will look like this:
Note: If you are using Jira 7.0 or higher with versions of Jira Workflow Toolbox older than 2.2.8, you should input the following boolean expression in parameter Conditional execution:
count(filterByStatus(siblingSubtasks(), "Closed, Done")) = count(siblingSubtasks())
This way we are preventing transition from being executed whenever the validation is not satisfied.
Alternative implementation
Using only a post-function in sub-tasks workflow, the other implementation is usually preferred since it also prevents parent issue from being closed until all sub-tasks are closed, even if you try to do it by manually triggering transition "Done" or "Close Issue". Anyway, sometimes you may want to allow manually overriding parent closing, even if there still are open sub-tasks.
This solution uses a post-function Copy parsed text to a field in transition "Done" or "Close Issue" in sub-task's workflow with the following configuration:
Conditional execution: count(subtasks()) = count(filterByStatus(subtasks(), "Closed, Done"))
Once configured, transition "Close Issue" in sub-task's workflow will look like this:
Other examples of that functions
Condition and validation on sub-tasks
- Close parent issue when all sub-tasks are closed
- Enforce certain type of sub-tasks to be "Resolved" to allow executing a transition
- Make linked issues, sub-tasks and JQL selected issues progress through its workflows
- Make parent issue progress through its workflow
- Proceed with a task only when all sub-tasks are completed
- Transition parent issue only when certain issue sub-task types are done
Boolean condition and validator with math. date-time or text-string terms
- 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
- Add all assignees of certain sub-task types to a "Multi-User Picker" custom field
- Add and remove a single or a set of items from multi valued fields
- Add current user to comment
- Add or remove request participants
- Add watchers from a part of the issue summary: "Summary_text - watcher1, watcher2, watcher3, ..."
- Assign issue based on the value of a Cascading Select custom field
- Assign issue to last user who executed a certain transition in the workflow
- Automatically close resolved sub-tasks when parent issue is closed
- Automatically reopen parent issue when one of its sub-tasks is reopened
- Calculate the time elapsed between 2 transition executions
- Close parent issue when all sub-tasks are closed
- Combine the values of several Multi-User picker fields
- Compose a parsed text including the "full name" or a user selected in a User Picker custom field
- Compose dynamic text by inserting field values in a text template
- Copy issue labels to a custom field
- Copy the value of a user property into a user picker
- Create a comment in sub-tasks when parent transitions
- Execute transition in epic
- Getting the number of selected values in a custom field of type Multi Select
- Limit the number of hours a user can log per day
- Make a sub-task's status match parent issue's current status on creation
- Make parent issue progress through its workflow
- Moving story to "In Progress" when one of its sub-tasks is moved to "In Progress"
- Moving story to "Ready for QA" once all its sub-tasks are in "Ready for QA" status
- Parse Email adresses to watchers list
- Parsing text from last comment and appending it to issue's summary
- Remove versions selected in a version picker custom field
- Replace certain issue link types with different ones
- Restrict parent issue from closing if it has sub-tasks that were created during a given parent issue status
- Set a Select or Multi-Select field using regular expression to express the values to be assigned
- Set assignee depending on issue type
- Set field depending on time passed since issue creation
- Set priority for issues that have been in a certain status for longer than 24 hours
- Set security level based on groups and project roles the reporter or creator are in
- Transition linked issues in currently active sprint
- Transition only a sub-task among several ones
- Transition parent issue only when certain issue sub-task types are done
- Update Cascading Select custom field with a value of the field in parent issue
- Update checkboxes custom field if a file has been attached during a transition
- Validation on issue attachments
- Validation on MIME types of issue attachments
- Writing a comment to blocked issues when blocking issues are resolved
Related Usage Examples
- 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
- Cascading select comparer
- Check project property
- Close parent issue when all sub-tasks are closed
- Condition and validation based on JQL query
- Condition and validation based on regular expression
- Condition and validation on linked issues
- Condition and validation on sub-tasks
- 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
- Except users in field
- Expression Parser
- If field A is populated then, field B must also be populated
- JWT Release Notes 2.1.26
- JWT Release Notes 2.1.29
- JWT Release Notes 2.2.8
- 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
- Only users in a field
- Prevent issue creation if another issue with same field value already exists
- Project Properties
- Read a project property
- Read user property
- 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
- Virtual Fields