Create an automation that syncs parent labels to child issues when the parent label is updated

Amanda Wong
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 10, 2025

Hi, I'm trying to create an automation in JIRA that accomplishes the following:

  • When a label is added to a parent issue, it is also added to the child issue (current config accomplishes this)
  • When a label is removed from a parent issue, it is also removed from the child issue (current config does not accomplish this)
  • Labels that are present on the child issue but not the parent issue are unchanged (current config accomplishes this)
  • All changes cascade down to child of child issues (current config does not accomplish this)

My current configuration looks like this:

jira automation screenshot 1.jpgjira automation screenshot 2.jpg

I have tried other configurations as well, such as

  • Setting value to {{triggerIssue.labels.concat(triggerIssue.parent.labels).unique}} --> results in child issue labels getting wiped out when parent labels are updated
  • Setting value to {{triggerIssue.labels.concat(triggerIssue.child.labels).unique}} --> results in child issue labels getting wiped out when parent labels are updated
  • Also adding "Copy from trigger issue" in the "Values to remove" box --> results in no change to child labels when parent labels are updated

Any guidance would be appreciated, thank you!

2 answers

1 accepted

2 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 11, 2025

Hi @Amanda Wong -- Welcome to the Atlassian Community!

Why are you using the generic Issue Updated trigger?

 

When using the trigger Field Value Changed specifically for the Labels field, the various {{fieldChange}} smart values may be used to detect what you ask: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--fieldChange--

For example:

additions to field: {{addedfieldChange.values}}

deletions from field: {{deletedfieldChange.values}}

 

Please note well:

Those smart values could be used with the ADDREMOVE option to edit the field, although I would recommend instead to use JSON to make the updates by iterating over the values found: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Labels

And as @Sahir Maharaj noted, synching field values between parent / child issues without full replacement can be challenging to get correct due to edge cases.  For example, what should happen when:

  1. parent issue does not have label ABC
  2. child issue adds label ABC
  3. parent later adds label ABC (which would trigger the rule to attempt to add it)
  4. parent later removes label ABC ===> Should the label be removed from the child?

 

Kind regards,
Bill

4 votes
Sahir Maharaj
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 11, 2025

Hello @Amanda Wong

Based on my experience, syncing labels between parent and child issues using Jira automation can be tricky, especially for cascading changes. To handle label removals, try modifying your rule to remove only labels present on the parent issue from the child.

You might need to use a condition or additional logic in the rule to ensure only specific labels are removed while leaving others untouched. Adding the "Copy from parent issue" operation could also help refine this behavior.

For cascading changes to children of children, you can use a branch rule that targets "All descendant issues."

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events