Automation For Jira - Writing a rule that copies a field from a Parent to a Child issue when this field is updated in the Parent issue

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

The purpose of this article is to show how to configure a rule meant to copy the content of a field from a parent issue to a child issue, in the case the parent/child relationship is based on the hierarchy level configuration which is a feature from Advanced Roadmap, and which is dictated by the Parent Link field.

It is important to note that the Parent/Child relationship is different from the Parent/Sub-Task relationship which is documented in configuring sub-tasks. The Copy from parent action in rule Branches can only be used in automations to copy a field from a parent to a sub-task issue. However, it cannot be used to copy the value of a field from a parent to a child issue. This is the reason why implementing such use case can be a bit tricky, which is why this KB article was written.

Note that the use case covered by this KB article is slightly different than the one covered in the other article Automation For Jira - Writing a rule that copies a field from a Parent to a Child issue as soon as the Child issue is linked to it. In this article, we will show how to copy the content of a field from a parent issue to a child issue, in the case where the field was updated in the parent issue.

Solution

For this solution, we will use the following example:

  • The hierarchy levels are configured so that the Initiative issue type is a parent of the Epic issue type:

Hierarchy levels
  • With such hierarchy level configuration, we will have the Parent/Child relationship described in the examples below:

    • The issue SCRUM-55 is a parent issue of the issue SCRUM-25 (as shown in the Child Issues panel):

      Child issue panel

    • The issue SCRUM-25 is a child issue of the issue SCRUM-55 (as configured via the Parent Link issue):

      Parent link

Rule configuration

  • The automation rule will be configured like this:

    • Add the Field Value changed trigger

      • Fields to monitor for changes: Choose the field of your choice (for example, "Labels") as the field to monitor

      • For: Choose the "Edit Issue" action

    • Add an Issue fields condition with the following settings:

      • Field: Issue type

      • Condition: Equal

      • Value: Initiative

    • Add a Branch rule component with the following settings:

      • Un-tick the option

        Only include issues that have changed since the last time this rule executed

      • Type of related issues: JQL

      • JQL: enter the JQL query below:

        "Parent Link" = {{triggerIssue.Key}}

      • Inside the Branch Rule component, add the Edit Issue action with the following settings

        • Choose the field of your choice (for example, "Labels") as the field to update, and select Copy from Trigger Issue

The rule will look like this (make sure to change Labels with the actual field you are trying to copy from the Parent to the Child issue):

Automation rule screenshot

Updated on August 1, 2024

Still need help?

The Atlassian Community is here for you.