Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation Q - Sync Team Field: Parent to Child

Claudia Dimick February 12, 2025

Hello Atlassian Community,

This is one of my first automations I have ever created for my company and I really need help. 

Automation Intended Outcome: When an issue is created or updated, automatically populate the "Team" field on all child tickets when the "Team" field is filled out on the parent ticket. 

I have created two separate automations: 

 

1st automation - for when an issue is created

2nd automation - for when an issue is updated

 

Neither automation is firing right now, so I'm curious what I am doing wrong. Any help is greatly appreciated!

Issue Created 2025-02-12 at 1.46.26 PM.jpg

Issue Updated 2025-02-12 at 1.46.40 PM.jpg

1 answer

0 votes
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.
February 12, 2025

Hi @Claudia Dimick 

Please post an image of the audit log details, expanding all of the sections / dropdowns.  That will help provide context for what is happening.

Until we see that...

You describe wanting to update the Child issues when the Parent's Team field changes.

Then condition to test if the Parent exists is not needed because the intended trigger is the Parent, correct?

 

You could create an additional rule (for Child issues) in case someone manually changes the Team field, allowing it to be reset back to the Parent's value.

 

Kind regards,
Bill

Claudia Dimick February 12, 2025

Hi Bill, 

Thanks for getting back to me! Here are the expanded audit logs for both automations: 

Issue Created Automation
Issue Created 2025-02-12 at 3.20.46 PM.jpg

 

Issue Updated AutomationIssue Updated 2025-02-12 at 3.21.36 PM.jpg

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.
February 12, 2025

Thanks for those images, and let's focus on one rule at a time, starting with the Issue Created one.

First, when using the Issue Created trigger, always add the Re-fetch Issue action immediately after the trigger.  The reason is that trigger can fire so quickly that some of the issue data may not be available to the rule yet...causing problems later.  The re-fetch will slow the rule a bit and reload the data before proceeding.

Next, please remove that Parent condition I noted earlier.

Looking at the log, VPMPROJ-704 did not have a value for the field, causing the condition to fail.  Does that sound correct?  If not, it may have been caused by the missing Re-fetch action I noted earlier.

 

Please make those changes, and then re-test your "created" rule.

 

Also please note: both of your rules have the same trigger, Issue Created.  Did you want the "updated" one to instead use the Issue Fields Updated trigger for the Teams field?

Claudia Dimick February 12, 2025

Focusing on the issue created rule, I removed the parent condition and added the Re-fetch issue action. This is how it is now set up. 1.jpg

 

When I went to re-test, the Team field still wasn't being populated.2.jpg

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.
February 12, 2025

Thanks for those updates and additional testing.  That shows when the Story was created, it did not have a Team value, and...when the Epic was created, it did not have any children yet (which makes sense).

 

Let's review the possible cases and which thus which rules may be needed.  I am assuming you are only using Epics and Stories; please let me know if there are other issue types used.

  1. When a Story is created with a parent Epic, copy the Team field from the parent Epic when the parent's Team is not empty
  2. When a Story is changed to a new parent Epic, copy the Team field from the new parent Epic
  3. When a parent Epic changes its Team, update all of the child Stories to match when the parent's Team is not empty
  4. When someone manually changes the Team for a Story with a parent Epic, set it back to the parent Epic's value when the parent's Team is not empty???

 

That would be 4 rules, where #1 would look like this:

  • trigger: issue created
  • action: re-fetch issue
  • related issues condition: parent exists
  • smart value condition:  (Please use your custom field id in place of "team")
    • first value:{{issue.parent.team}}
    • condition: does not equal
    • second value: leave as empty
  • action: edit issue to set the field

Rule #2 would be nearly the same, with a different trigger checking for a change to the Parent

Rule #3 inverts this, as it is from the parent perspective.

  • trigger: field value changed for Team
  • condition: issue type equals Epic
  • smart value condition: (Please use your custom field id in place of "team")
    • first value: {{issue.team}}
    • condition: does not equal
    • second value: leave as empty
  • branch to child issues
    • action: edit issue to set the field

Rule #4 would be nearly the same as #1, with a different trigger on field value changed for Team

 

How does this compare to what you are trying to accomplish?  Thanks!

Claudia Dimick February 20, 2025

Hi @Bill Sheboy apologies for the delay here, I was OOO! 

The 3rd use case most aligns with what my team is looking to achieve: "When a parent Epic changes its Team, update all of the child Stories to match when the parent's Team is not empty." 

However, my team is using many issue types at the Epic hierarchy level. There are 10 issue types at this level.

Does this change Rule #3 as is laid out above?

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.
February 20, 2025

Hi, and welcome back from your OOO time!

To update that rule template, change that first condition to match your types:

condition: issue type is one of Epic_A_Type, Epic_B_Type, Epic_C_Type, ...

Claudia Dimick February 21, 2025

Hi @Bill Sheboy

 

Thank you!

 

Okay I updated but I am confused about the last part of the rule you mapped out (see bolded below): 

Rule #3 inverts this, as it is from the parent perspective.

  • trigger: field value changed for Team
  • condition: issue type equals Epic
  • smart value condition: (Please use your custom field id in place of "team")
    • first value: {{issue.team}}
    • condition: does not equal
    • second value: leave as empty
  • branch to child issues
    • action: edit issue to set the field

 

The team requesting the automation consists of multiple sub-teams. They don't want a pre-fixed value for the team field. Instead, they want the team field to be populated for all child tasks when it is filled out.

 

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.
February 21, 2025

I thought you wanted to copy the Team from the trigger issue to the child issues.  Is that not the case?

Claudia Dimick February 21, 2025

Hi @Bill Sheboy,

Yes, that’s correct—I do want to copy the Team field from the parent to the child issues, but only when it is filled out. Since the team field can have multiple possible values, we don’t want to set a fixed one—just ensure that whatever is selected on the parent gets passed down.

Intended Outcome: When an issue is created or updated, the "Team" field should automatically populate on all child tickets when it is filled out on the parent ticket.

Let me know if that helps clarify!

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.
February 21, 2025

The Smart Values Condition is checking that the value is not empty before the rule continues.

Then in the Edit Issue action, the field may be selected to Copy from Trigger Issue.  That will copy all values currently in the parent to the children, regardless of what is selected.

Claudia Dimick February 21, 2025

Thank you for this--however these are the only options I am given for the "Edit Issue" action. I don't see anything where it says to "Copy from Trigger Issue". Could you send me a screenshot of what it should look like for me on my end?

Rule builder - Automation - Jira 2025-02-21 at 2.35.17 PM.jpg

 

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.
February 21, 2025

Please select your field from the dropdown list, Choose fields to set.

At the right side of the field, there will be a ... option, select that, and then COPY.

Now click on the field, changing the source, Issue to copy value from, to Trigger issue

For example:

Screenshot 2025-02-21 141101 - Copy.png

Claudia Dimick February 21, 2025

This is great, however I cannot select my Team field. It only allows me to use the advanced field editing for my field. 

Screenshot 2025-02-21 at 4.07.04 PM.png

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.
February 21, 2025

Thanks for confirming that as it shows JSON will be needed instead: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Single-select-custom-field

For example:

{
"fields": {
"customfield_12345" : {
"id": "{{triggerIssue.customfield_12345.value.id}}"
}
}
}

Please your own custom field ID to select and set the value. 

If the field is not single-selection, please let me know.

Claudia Dimick February 24, 2025

Hi Bill, thank you for this! I really appreciate your diligent help here. 


I added in the JSON to define the "Team" field using advanced field configurations you sent me, but it is still not working. The "Team" field in our instance is a "Team Picker (single team)" field type. The automation doesn't seem to be recognizing that a value is getting added to the "Team" field. 

This was what was happening when I used your JSON: 

{
"fields": {
"customfield_12345" : {
"id": "{{triggerIssue.customfield_12345.value.id}}"
}
}
}

Audit log - Automation - Jira 2025-02-24 at 4.10.02 PM.jpg


I was instructed to change the JSON to this, but it is still not working.

{
"fields": {
"customfield_10001": {
"id": "{{triggerIssue.fields.customfield_10001.id}}"
}
}
}

Audit log - Automation - Jira 2025-02-24 at 4.15.57 PM.jpg 
Both say "No related issues could be found". Any thoughts here?

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.
February 24, 2025

I recommend focusing on the branch in the audit log.  That shows no issues where found, and so based on the earlier rule you showed that means there was no child issue.

Would you please show your current, complete rule?

 

Also...if the Atlassian Support team is already helping with the rule, I recommend sticking with them for guidance as they can directly interact with your rule and Jira site to help.

Claudia Dimick February 25, 2025

Hi Bill, here is the full complete rule. Atlassian Support cannot help me with this as they do not do consultative support, unfortunately.

Rule builder - Automation - Jira 2025-02-25 at 3.57.13 PM.jpg

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events