Move parent and child issues together in the workflow

In this recipe, you will learn how to move the parent issue and child issues together. Here the Parent-Child relationship can be

  • Jira Software “Parent-Subtask”

  • Jira Software “Epic-Story”

  • Advanced Roadmaps (Portfolio) “Parent link”

  • Issues linked through the links available in “Issue Linking”

Consider a case where you want to move the issue to the same status as its children and not close it until all its children are closed.

What do you need?

Configure

Consider the following workflow shown in Figure 1

Figure 1

Workflow

Step 1: Add the Transition related issues post-function to the “In Progress” transition

  1. Add the Transition Related Issues post-function to the “In Progress” transition of the subtasks workflow

    1. Under “Which Issues” select

      1. “Parent issue of the current subtask” for Jira Software Parent-Subtask

      2. “Epic of the current issue” for Jira Software Epic-Story

      3. Select “Parent issue of the current issue in the Portfolio hierarchy” for Advance Roadmaps (Portfolio for Jira)

      4. Select “Issues linked to the current issue through the following link type” and the link in “Issue Link” for System links (Issue Linking)

    2. Using the “Transition Picker” select the “In Progress” transition of the Parent workflow

    3. Select "Conditional execution” and input for the following script

      relatedIssue.status.name != "In Progress"
    4. Save the post-function

  2. Move the post-function after “Update change history for an issue and store the issue in the database” built-in post-function

Step 2: Add the Transition related issues post-function to the “Done” transition

  1. Add the Transition Related Issues post-function to the “Done” transition

    1. Under “Which Issues” select

      1. “Parent issue of the current subtask” for Jira Software Parent-Subtask

      2. “Epic of the current issue” for Jira Software Epic-Story

      3. “Parent issue of the current issue in the Portfolio hierarchy” for Advance Roadmaps (Portfolio for Jira)

      4. “Issues linked to the current issue through the following link type” and the link type (eg: “is blocked by”) in “Issue Link” for System links (Issue Linking)

    2. Using the “Transition picker” select the “Done” transition of the Parent workflow

    3. Select the "Conditional execution” and input for the following script

      issue.subTaskObjects.every{it.status.name == "Done"}
    4. Save the post-function

  2. Move the post-function after “Update change history for an issue and store the issue in the database” built-in post-function

  3. Publish the workflow

Step 3: Hide transition “Done” until all the subtasks are in Done status

  1. Add the Related Issues Status Condition to the “Done” transition of the parent workflow

    1. Under “Which Issues” select

      1. “Sub-tasks of the current issue” for Jira Software Parent-Subtask

      2. “Issues that belong to the current Epic” for Jira Software Epic-Story

      3. “Child issues of the current issue in the Portfolio hierarchy” for Advance Roadmaps (Portfolio for Jira)

      4. “Issues linked to the current issue through the following link type” and the link type (eg: “blocks”) in “Issue Link” for System links (Issue Linking)

  2. Select “Done” status “Status(es)”

  3. Save the condition

  4. Publish the workflow

Related articles