# Automatically Sync Statuses of Related Work Items

Have you ever wondered how to keep parent and child issue statuses in sync? Consider the following workflow requirements:

* When the last child of an Epic is closed → automatically close the parent.
* When the parent is closed → close all its children.
* When the first child is transitioned to *In Progress* → move the parent to *In Progress* as well.
* Sync statuses of linked items

With the [**Transition work items**](https://docs.forgappify.com/workflow-building-blocks-for-jira/post-functions/transition-work-items) post-function from *Workflow Building Blocks*, achieving this is easier than you might think.

## Perform actions in new workflow editor  <a href="#perform-actions-in-new-workflow-editor" id="perform-actions-in-new-workflow-editor"></a>

First, some basics (skip this part if you’re already an experienced administrator):

In the new workflow editor, all workflow blocks — conditions, validators, and post-functions — are now called **Rules**, grouped into sections:

* Post-functions -> Perform actions
* Validators → Validate details
* Conditions → Restrict transitions

<figure><img src="https://4067441311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh6orV4J25NOSJvrMyLKk%2Fuploads%2FB9UcXuzoisgqsOqxQiCb%2Ftransition_article_workflow_editor.png?alt=media&#x26;token=fc3920cb-6586-4d20-8aa4-e7d43b19a801" alt="Jira new workflow editor screenshot showing post functions displayed under the Perform action section for workflow configuration"><figcaption><p>New workflow editor showing post functions listed under the Perform action section</p></figcaption></figure>

**Setting up actions during a transition**

1. In the workflow editor, click on the transition (the line with arrows) → the sidebar will appear.
2. In the sidebar, click the **+** icon in the **Rules** section → the *Add rule* dialog opens.
3. From the Rule Types, select **Perform actions**.
4. Choose the action you want to configure and complete the setup.

*If you have the* [*Workflow Building Blocks for Jira*](https://marketplace.atlassian.com/apps/1233642/workflow-building-blocks-for-jira?hosting=cloud\&tab=overview) *app already installed, you’ll also see* [*Transition work items (WBB)*](https://docs.forgappify.com/workflow-building-blocks-for-jira/post-functions/transition-work-items) *available as an action.*

### Close parent when the last child work item is closed  <a href="#close-parent-when-the-last-child-work-item-is-closed" id="close-parent-when-the-last-child-work-item-is-closed"></a>

You can configure the **Transition work items** rule in just three steps:

1. Define preconditions to decide whether the action should be executed or skipped.
2. Select which related work item should be transitioned.
3. Choose the next available status to transition to.

<figure><img src="https://4067441311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh6orV4J25NOSJvrMyLKk%2Fuploads%2FnNHmJ5V2njHpOLjcnU47%2Ftransition_article_close_parent.png?alt=media&#x26;token=137cf280-70b8-4ec2-b3af-55df7cdb8c39" alt="Workflow Building Blocks for Jira showing Transition work items post function (rule) with Preconditions using the Sibling source to close parent when last child is closed"><figcaption><p>Transition work items configuration for closing the parent when the last child is closed, using Preconditions with the Sibling source</p></figcaption></figure>

#### Siblings preconditions <a href="#sibling-preconditions" id="sibling-preconditions"></a>

Our powerful preconditions module allows you to refine when an action should run.

In this example, we want the rule to execute **only when the last child issue is being closed**. To achieve this, we’ll use the **Sibling** source, which lets you check the status of all issues under the same parent, excluding the current issue.

If all the siblings are already closed → the parent issue can be closed.

#### Prevent closing the parent <a href="#prevent-closing-the-parent" id="prevent-closing-the-parent"></a>

To achieve the opposite behavior — preventing an issue from being closed until all of its children or blocking linked issues are resolved — check out [linked-issues](https://docs.forgappify.com/workflow-building-blocks-for-jira/conditions-validators/linked-issues "mention"). This validator greatly simplifies the task and ensures workflow rules are enforced automatically.

### Close all children when the parent is closed <a href="#close-all-children-when-the-parent-is-closed" id="close-all-children-when-the-parent-is-closed"></a>

You can configure this behavior by adding a **Transition Work Items** rule on the transition to the **Done** status.

If your parent issue type shares a workflow with its children, make sure to add preconditions so the rule executes **only for the parent issue type**.

<figure><img src="https://4067441311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh6orV4J25NOSJvrMyLKk%2Fuploads%2FUxyXWb1xwYzGvunGKSma%2Ftransition_article_preconditions_epic.png?alt=media&#x26;token=ba3070be-e699-4316-9bc4-2a79682a3d48" alt="Workflow Building Blocks for Jira showing Preconditions example, that validates when the issue type is Epic"><figcaption><p>Preconditions configuration example that is fulfilled when the issue type is Epic</p></figcaption></figure>

*To learn more about how preconditions in WBB work, read* [ultimate](https://docs.forgappify.com/workflow-building-blocks-for-jira/conditions-validators/ultimate "mention").

#### Within the rule setup, select:

1. Children - for work items to transition
   1. Issue types: Any - if you want to transition all children
2. Done - as the destination status
3. If the transition includes a screen, you can provide field values:
   1. You can either set new values or copy them from the parent.

<figure><img src="https://4067441311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh6orV4J25NOSJvrMyLKk%2Fuploads%2FcLV30NmgWwaUYLxSzK1p%2Ftransition_article_children.png?alt=media&#x26;token=651a21b6-3465-4095-8dd4-adf93df7d978" alt="Workflow Building Blocks for Jira provides a Transition Work Items rule configuration. This lets you automatically close all child issues when the parent is closed, with an option to copy values from the parent that are required for the transition screen"><figcaption><p>Transition work items rule configuration for closing all children when the parent is closed, with options to set field values or copy them from the parent if a transition screen is used</p></figcaption></figure>

### Sync statuses of linked items <a href="#sync-statuses-of-linked-items" id="sync-statuses-of-linked-items"></a>

When you have linked items across different projects — for example, a **Feature Request** in JSM and a **Story** in Jira Software — you may want to keep their statuses in sync automatically. This way, customers are notified right away about progress without extra manual updates.

To achieve this, add a **Transition Work Items** rule on the relevant transition in your development project and within the rule setup, select:

1. Linked work → to transition the related item in JSM.
2. Select link type → choose the appropriate link if multiple link types exist in the project.
3. Choose matching status → define the status in the JSM project that should reflect the change.

<figure><img src="https://4067441311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh6orV4J25NOSJvrMyLKk%2Fuploads%2FlQGnJxEOGthO88FtiMk2%2Ftransition_article_sync_linked-items.png?alt=media&#x26;token=33f1e46c-b481-41fd-a633-bbc6799c3e69" alt="Workflow Building Blocks for Jira showing Transition work items post function rule example for transitioning linked items"><figcaption><p>Transitioning linked items configuration example</p></figcaption></figure>

## Loop transitions - Automation from workflow <a href="#loop-transitions-automation-from-workflow" id="loop-transitions-automation-from-workflow"></a>

What is a loop transition?

A loop transition is a transition that starts and ends in the same status. You can create one in the workflow editor simply by connecting the dots on the same status.

<div data-full-width="false"><figure><img src="https://4067441311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh6orV4J25NOSJvrMyLKk%2Fuploads%2FWbDQPAnAjx32qFQjhIio%2Ftransition_article_loop_transition.png?alt=media&#x26;token=d73e59b6-ccf0-4075-b618-6a41d3c10cf9" alt="Loop transition configuration example in the new workflow editor" width="356"><figcaption><p>Loop transition configuration example in the new workflow editor</p></figcaption></figure></div>

Just like regular transitions, you can add conditions to control **when** the action is available and **for whom**. For example, you can add a **Restrict who can move an issue** rule.

On the issue view, loop transitions appear when you click the **Automation** button at the top of the screen. The transition name you provide will be displayed in the **From Workflow** section.

<figure><img src="https://4067441311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh6orV4J25NOSJvrMyLKk%2Fuploads%2FKOBhFt0NsuJTReCrfuSf%2Ftransition_article_automation.png?alt=media&#x26;token=84f3afa7-ee17-4685-8b36-e24fbe842299" alt="Loop transitions on the issue view, accessible from the Automation button, with the transition name shown in the From Workflow section"><figcaption><p>Loop transitions on the issue view, accessible from the Automation button, with the transition name shown in the From Workflow section</p></figcaption></figure>

### Bulk Approve linked required items <a href="#bulk-approve-linked-required-items" id="bulk-approve-linked-required-items"></a>

Configuration steps:

1. Create a loop transition from/to Approved status
2. Add conditions - e.g restrict to Release Managers role
3. Add Transition work items (WBB) rule, and select:
   1. Linked work - for items to transition
   2. Choose “requires“ link type
   3. Approved - as destination status

<figure><img src="https://4067441311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh6orV4J25NOSJvrMyLKk%2Fuploads%2FxHvGe4iyotzrCAS1qYcP%2Ftransition_article_approve_linked.png?alt=media&#x26;token=f08df33f-0282-4174-af3f-4af9f6bd95bf" alt="Workflow Building Blocks for Jira showing Transition work items post function / rule configuration for bulk approving linked required items"><figcaption><p>Configuration example for bulk approving linked required items</p></figcaption></figure>

As a result, the **Bulk Approve Required Items** action appears on the Issue View. This allows Release Managers to approve up to 100 linked items at once, significantly speeding up the entire process.
