Propagate custom filed value on Epic child items
Asked by Vasilisa Yermakova:

Hello!

I'm trying to create an automation that will set the value of a custom field to the same value as their parent Epic.

So far I was able to make it work only for already existing items within Epic, but cannot make it work to set the value for newly added child items or items added outside of the current Epic.

Please see 2 screenshots with the automations I tried.

I believe the problem is that when I create a task even using "Add a child issue" for the specific Epic, it doesn't relate to any parent/Epic yet so it cannot understand where to take the value from. This is how I understand the error message shown in audit log (see attached).

And only after I perform some changes on child item it gets the value from the parent Epic.

Please let me know how should I improve these automations to make them work correctly. I believe this should be a common use case but unfortunately I wasn't able to find some similar solutions.

![SCR-20230913-kqx.png](https://community.atlassian.com/t5/image/serverpage/image-id/280444i282F40734F925F08/image-size/large?v=v2&px=999 "SCR-20230913-kqx.png")![SCR-20230913-ksn.png](https://community.atlassian.com/t5/image/serverpage/image-id/280445i25A29D35D41E6357/image-size/large?v=v2&px=999 "SCR-20230913-ksn.png")![SCR-20230913-kz2.png](https://community.atlassian.com/t5/image/serverpage/image-id/280446i7C4D9FD13F8CFF19/image-size/large?v=v2&px=999 "SCR-20230913-kz2.png")


Answers:
author: Boldizs?r Vermes
body: [@Vasilisa Yermakova](/t5/user/viewprofilepage/user-id/4960131), try using *Value changes for: parent* as a trigger instead of when an issue is created/updated. This will result in starting the automation only in case of a known epic.

I suggest creating a fallback option for issues that does not have an epic to clear the field value of them.

comments: author: Vasilisa Yermakova
body: hi [@Boldizs?r Vermes](/t5/user/viewprofilepage/user-id/5089142)

thanks a lot for your answer.

I was actually trying to use this trigger, but I didn't understand much its logic.

So the fact is that it works in cases when issue was created in backlog and then added to the Epic -\> it works.

but in case if I try to create a new issue right under the Epic by using "add a child issue" button, the automation fails with the error in logs that I shared above.

I thought that newly created issue should be triggered as well, but it never happened.

What would be your recommendation for me to try next?

I'm new to automation and would highly appreciate any help!


author: Boldizs?r Vermes
body: An automation rule of mine that sets a field when the issue is created or later the epic is changed would be as simple as the image shows:![Untitled.png](https://community.atlassian.com/t5/image/serverpage/image-id/281454i6D85879B099E3958/image-size/large?v=v2&px=999 "Untitled.png")


author: Vasilisa Yermakova
body: [@Boldizs?r Vermes](/t5/user/viewprofilepage/user-id/5089142) this is so strange as I don't know what I can be doing wrongly..

I removed additional conditions to keep the rule as simple as it is on your sample,

but still no success with items created within the Epic - rule always fails.

And even for the other case when I link items to the Epic created outside of it - rule executes twice, where first execution always fails but the second works.

p.s. In all cases the rule tries to execute twice. does it works the same for you?

![SCR-20230919-kf2.png](https://community.atlassian.com/t5/image/serverpage/image-id/281458i8986AD3C6E11B293/image-size/large?v=v2&px=999 "SCR-20230919-kf2.png")![SCR-20230919-kg4.png](https://community.atlassian.com/t5/image/serverpage/image-id/281459iD9A215BF69969039/image-size/large?v=v2&px=999 "SCR-20230919-kg4.png")![SCR-20230919-kml.png](https://community.atlassian.com/t5/image/serverpage/image-id/281461i4B132AD2BBD4BDEE/image-size/large?v=v2&px=999 "SCR-20230919-kml.png")


author: Boldizs?r Vermes
body: No, I do not have double rule executions.

I guess changing the Epic works like clearing the previous one and adding the new one in two steps. I experienced the same before but not this time when creating the screenshot for you. Add an IF, ELSE condition after the trigger to set the given field only if the trigger issue has an epic:  
![Untitled.png](https://community.atlassian.com/t5/image/serverpage/image-id/281469i70F3BC322C63FAF6/image-size/large?v=v2&px=999 "Untitled.png")

You can use the else branch to empty the value of the given field of the issue if it does not have an epic.


author: Vasilisa Yermakova
body: [@Boldizs?r Vermes](/t5/user/viewprofilepage/user-id/5089142) I wish it worked but there is still something wrong :/

after adding the if block the rule still tries to execute twice.

For items created without Epic and then added into it -\> first execution does nothing, second execution successful  
For items created within Epic via "Add a child issue" -\> both execution do nothing

![SCR-20230919-nw5.png](https://community.atlassian.com/t5/image/serverpage/image-id/281542i4AC1A8BE140DA80B/image-size/large?v=v2&px=999 "SCR-20230919-nw5.png")![SCR-20230919-nwt.png](https://community.atlassian.com/t5/image/serverpage/image-id/281543i08E675C5B4F52197/image-size/large?v=v2&px=999 "SCR-20230919-nwt.png")![SCR-20230919-ny4.png](https://community.atlassian.com/t5/image/serverpage/image-id/281544iBF7AFCEBF183F38A/image-size/large?v=v2&px=999 "SCR-20230919-ny4.png")


author: Boldizs?r Vermes
body: That's strange.

First of all, be sure that the automation rule cannot be triggered by another rule. Have this checkbox unticked on the *Rule details* page:![Untitled.png](https://community.atlassian.com/t5/image/serverpage/image-id/281596iB9331039AD2167F3/image-size/large?v=v2&px=999 "Untitled.png")

Try to figure out why the rule is executed twice. What do you see in the history of the given issue after changing the epic? Has the parent been changed twice? Do you have another rule that touches the epic/parent field simultaneously?

Try putting *Log actions* into your rule to see the data it processes. What is the parent issue, what are the values of Milestone fields of the given issue and the parent issue?


author: David Leal
body: Please the details of the Edit issue field and also what exactly you want to achieve with the rule, it is not clear to me from your question. Thanks.

comments: author: Vasilisa Yermakova
body: sure, thank you

I tried both options to set "Issue to copy value from" as Epic issue and Parent issue.

For the first automation that works it is set to "Epic issue".

![SCR-20230913-mct.png](https://community.atlassian.com/t5/image/serverpage/image-id/280466i3C4220EBE84F67A5/image-size/large?v=v2&px=999 "SCR-20230913-mct.png")


author: Vasilisa Yermakova
body: From the rule I want to achieve that all child items inside the Epic got the same value for "test field" as it is for the Epic.

And the rule should be applied no matter if they:

- were inside this Epic before,

- were just added from backlog or from another Epic;

- or were just created by clicking "Add a child issue" right under that Epic

I hope it makes clear what I'm trying to achieve.


author: Vasilisa Yermakova
body: hi [@David Leal](/t5/user/viewprofilepage/user-id/1567948)

I'll just ping you in case you don't get the notifications about new answers, thank you


author: David Leal
body: [@Vasilisa Yermakova](/t5/user/viewprofilepage/user-id/4960131) sorry for the delayed response, I was busy, so basically what do you want when the epic changes the value for a given field, then you want it to propagate down the the corresponding child issues, correct?

I have a similar rule to this one, that I think is can help you for your purpose:

Lets say you want to populate down the component values:

![Screenshot 2023-09-19 at 4.27.01 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/281602iF021BC2E4E12545E/image-size/large?v=v2&px=999 "Screenshot 2023-09-19 at 4.27.01 PM.png")

Now you create a branch for all issues within that epic:

![Screenshot 2023-09-19 at 4.28.12 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/281603i0BA2705526073BD7/image-size/large?v=v2&px=999 "Screenshot 2023-09-19 at 4.28.12 PM.png")

and you copy the component field from the epic:

![Screenshot 2023-09-19 at 4.28.45 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/281604iDF355E543D0B756D/image-size/large?v=v2&px=999 "Screenshot 2023-09-19 at 4.28.45 PM.png")

I hope it helps,

David


author: Vasilisa Yermakova
body: hi [@David Leal](/t5/user/viewprofilepage/user-id/1567948)

thanks for your answer.

Actually, I was able to make the automation work for the case you described. So yes, if I change the field value for Epic -\> it changes the same field for child items.

The case I'm struggling with is when I create new child items for the given Epic and want it to get the same value as Epic has (without changing the value for Epic, as it is already defined)

I was trying to use "Value changes for Parent Link", but it doesn't affect issues that I create within Epic using "Add a child issue" button. It works only for issues that I created in backlog with no Epic -\> and only then put them inside the given Epic.

For this case I created a separate automation and this is how it looks like now:

![SCR-20230920-lua.png](https://community.atlassian.com/t5/image/serverpage/image-id/281784i95EC6BDBF0205D27/image-size/large?v=v2&px=999 "SCR-20230920-lua.png")

Do you know how to solve this case? There must be some error as it doesn't work for me, but I don't understand what I'm doing wrongly


author: David Leal
body: [@Vasilisa Yermakova](/t5/user/viewprofilepage/user-id/4960131) for this case in a similar way:

![Screenshot 2023-09-20 at 1.36.04 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/281837iD962F18BC4FF0A65/image-size/large?v=v2&px=999 "Screenshot 2023-09-20 at 1.36.04 PM.png")

The rule is triggered when an issue is created, then you check it is not an Epic and it has an Epic linked, then you update your field (in the sample I use component) to update the field based on the corresponding Epic value.

The condition Epic exists is the following:

![Screenshot 2023-09-20 at 1.41.29 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/281838i7075E442CDCE9F2B/image-size/large?v=v2&px=999 "Screenshot 2023-09-20 at 1.41.29 PM.png")


author: Vasilisa Yermakova
body: Hi [@David Leal](/t5/user/viewprofilepage/user-id/1567948)

I've created the exact same rule, but still it shows that newly created issue didn't match the condition so the rule don't perform any actions.

Can it be that Epic still doesn't exist for the issue when I create it as a child for Epic?

As I understand from the audit log the operation that fails is "And Epic exists", but I don't understand why. I thought it may be connected to the "Rule restricted to projects", but I'm in the right project doing all these changes.

You can see on the screenshots attached the details from audit log and History for newly created issue (LTC-2088)

![SCR-20230921-dc1.png](https://community.atlassian.com/t5/image/serverpage/image-id/281949i4B1277F19703CC5A/image-size/large?v=v2&px=999 "SCR-20230921-dc1.png")![SCR-20230921-dbp.png](https://community.atlassian.com/t5/image/serverpage/image-id/281950i6F3C60587B23BE91/image-size/large?v=v2&px=999 "SCR-20230921-dbp.png")


author: David Leal
body: Well, the rule assumes the epic exists you need to link an existing epic on creation. The rule is triggered when the child issue is created. Did you try to log the information (Log Action) to see what is entering into the rule, to have more information.