Jira Automation Update Child Issue of a Child
Asked by Shmuel_ Dave:

Dear Atlassian Automation Community,

I have defined my Jira issues hierarchy to **Initiative** \>**Epic** \>**Task** I have defined a **Related Product** field on each of the issue types and would like to set an automation that will cascade the **Related Product** field value set in the **Initiative** level to all it's Children (i.e. branch for children and then branch once again for their children)  

![Jira issues hierarchy.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/334921i5A6C3A55D42B527C/image-size/large?v=v2&px=999 "Jira issues hierarchy.jpg")

Can anyone assist in suggesting an automation approach to achieve this goal ??


Answers:
author: Duc Thang TRAN
body: Hello [@Shmuel_ Dave](/t5/user/viewprofilepage/user-id/5541389)

I can suggest to use another way :

* trigger when field value changed ( related product)
* Then add brand with JQL like this :
  * issue in portfolioChildIssuesOf("{{triggerissue}}")
  * edit issue : with copy value of the field from trigger issue

Hope this can work on your instance

comments: author: Shmuel_ Dave
body: **NICE !!!!!!!!**   
Thank you ??

![Update Child Issue of a Child.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/334929i6C6A19675F2CDFA8/image-size/large?v=v2&px=999 "Update Child Issue of a Child.jpg")


author: Bill Sheboy
body: Hi [@Shmuel_ Dave](/t5/user/viewprofilepage/user-id/5541389) -- Welcome to the Atlassian Community!

You may need additional automation rules if you want to handle other possible scenarios / edge cases. For example:

* What should happen if someone manually changes the Related Product field in a Task or Epic?
* What should happen if the parent Epic of a Task changes?
* What should happen if the parent Initiative of an Epic changes?
* What should happen if the parent Epic of a Task is deleted, leaving the child Tasks in place with no connection to the prior Initiative, grandparent?
* etc.

Kind regards,  
Bill


author: Shmuel_ Dave
body: Yep...  
That's correct ??  
Here is what i have added so far -

![Untitled.png](https://community.atlassian.com/t5/image/serverpage/image-id/335575i7DC890AA8362B74F/image-size/large?v=v2&px=999 "Untitled.png")

Added one for when issues are created under an existing issue -  
![Untitled.png](https://community.atlassian.com/t5/image/serverpage/image-id/335474i63A695986F3534D3/image-size/large?v=v2&px=999 "Untitled.png")


author: John Funk
body: Hi Dave - Welcome to the Atlassian Community!

I usually do that with two different rules. So create a rule based on a Field Value Changed rule. Leave it for all types of changes.

Then add a Condition for Issue type = Initiative

Then add a Branch for Children

Then add an action for Edit Issue and select the same field.

In the blank below the field name put: {{triggerIssue.Related Product}}

This will update the Epic field with the value from the Initiative.

Then copy that rule and give it a new name.

Change the new copied one to change the Condition from Initiative to Epic. Be sure to check the box on the Rule Details to allow it to fire the trigger when another rule fires.

Then you are ready to test it out. The first will fire and update the value in the Epics, which will cause the second rule to fire, which will update all of the Epics' children.