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

Still need help?

The Atlassian Community is here for you.

Ask the community

robotsnoindex

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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.

(info) 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.

Environment

  • Jira Server/Data Center on any version from 8.0.0 (Or Jira Service Management from 4.0.0)
  • Automation For Jira on any version from 7.4.0

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:
  • 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):
    • The issue SCRUM-25 is a child issue of the issue SCRUM-55 (as configured via the Parent Link issue):

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:
    • (warning) 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):



Last modified on Jul 2, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.