Forums

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

Propagate custom filed value on Epic child items

Vasilisa Yermakova September 13, 2023

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.pngSCR-20230913-ksn.pngSCR-20230913-kz2.png

2 answers

0 votes
Boldizsár Vermes
Contributor
September 18, 2023

@Vasilisa Yermakova, 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.

Vasilisa Yermakova September 19, 2023

hi @Boldizsár Vermes 

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!

Boldizsár Vermes
Contributor
September 19, 2023

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

Vasilisa Yermakova September 19, 2023

@Boldizsár Vermes 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.pngSCR-20230919-kg4.pngSCR-20230919-kml.png

Boldizsár Vermes
Contributor
September 19, 2023

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

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

Vasilisa Yermakova September 19, 2023

@Boldizsár Vermes 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.pngSCR-20230919-nwt.pngSCR-20230919-ny4.png

Boldizsár Vermes
Contributor
September 19, 2023

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

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?

0 votes
David Leal
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.
September 13, 2023

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.

Vasilisa Yermakova September 13, 2023

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

Vasilisa Yermakova September 14, 2023

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.

Vasilisa Yermakova September 19, 2023

hi @David Leal 

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

Like David Leal likes this
David Leal
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.
September 19, 2023

@Vasilisa Yermakova 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

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

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

I hope it helps,

David

Vasilisa Yermakova September 20, 2023

hi @David Leal 

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

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

David Leal
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.
September 20, 2023

@Vasilisa Yermakova  for this case in a similar way:

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

Vasilisa Yermakova September 21, 2023

Hi @David Leal 

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.pngSCR-20230921-dbp.png

David Leal
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.
September 21, 2023

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events