---
title: "Move parent issue to done when all sub-tasks are done"
canonical: "https://support.appfire.com/space/CSOT/68753886/Move%20parent%20issue%20to%20done%20when%20all%20sub-tasks%20are%20done"
format: markdown
---
# Scenario

When all the sub-tasks are completed, you would like to automatically move the parent issue to be in done status only if it's not done.

## Steps

<span style="color: #333333">The following steps demonstrate how to configure Create on Transition's </span><span style="color: #333333">*Update issues post function*</span><span style="color: #333333">, using the transition feature along with JQL query and regex inspection:</span>

|  |  |  |
| --- | --- | --- |
| ![image](media://0304071a-be0d-4969-81f5-6b32308f7068) | ## Step 1<br>As a Jira Administrator or Workflow Administrator:<br>1. Navigate to your workflow.
2. Edit your workflow to create a draft version.
3. Select *Done (31)* transition
4. Select the *Post Functions* tab.
5. Click* Add post function*
6. Select *Update issues (Bob Swift) *post function and add | ![image](media://fe90abd3-23be-4d1a-bfc4-204ca6b3b7f1) |
| ![image](media://be765fce-db07-4315-adf8-6fd3518e1fa9) | ## Step 2<br>Within the Issue Fields screen:<br>1. Select the *Detailed Fields* tab.
2. Select only "Parent issue key" in the *Issues to update *field
3. Enter Done in the *Transition* field. | ![image](media://be64ee35-98bb-416c-be03-1a40a4c765d3) |
| ![image](media://6430f780-da7f-4cc4-a4b1-8b7c52dca8f6) | ## Step 3<br>Define the JQL query that needs to be used in conjunction with regex to inspect the number of issues that are not in the Done status.<br>1. Select the *Conditions & Configuration* tab.
2. Enter "%parent_status%" in the *Condition 1* field.
3. Enter "Done" in the *Regular expression pattern* field.
4. Select *Negative *matching condition, so we only update the parent issue when the parent issue's story is not "Done".
5. Scroll down until you find *JQL query* field.
6. Enter "parent = %parent_key% and status != Done" in the* JQL query* field
7. Enter "%jql_result_count%" in the *Condition 2* field.
8. Enter "0" in the *Regular expression pattern* field.
9. Select *Exact *matching condition, so we only transition the parent issue to be done when all the subtasks are done.
10. Click the **Add** button to save your configuration. | ![image](media://455f721a-31df-4dd2-8dce-7b50fe3bf756) |
| ![image](media://1ae1798f-12db-4846-9a26-db8d27e9eff2) | ## Step 4<br>1. Ensure to publish your workflow. It is always recommended to save a backup of the previous workflow when prompted.
2. Navigate to an issue with sub-task issues that is not done.
3. Complete all the sub-task issues as done
4. Validate if the parent issue is also moved to done status. |  |