Change a field in Subtask when moving to parent
Asked by Friedemann Wagner:

Hi all,

i have a question on rule automation.

Our teams works a lot with the lables and also subtasks. Whenever we add a task to a parent we would like to have the lable of the child to be filled with the lable of the parent.

As within the Rule automation i could only find one parent I used it but the rule itself does not work.

Below you can see my current rule which does not work...

Does anyone here has a similar issue / solution?

Thanks a lot

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


Answers:
author: Daniel Ebers
body: Hi [@Friedemann Wagner](/t5/user/viewprofilepage/user-id/4476313)

am I getting it right that you want to create sub-task under a parent issue where automation should bring the labels of the parent to the sub-tasks?

If so I am wondering if the following rule would work for you (testing in my instance it did the job properly):

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

Because you named your rule "Label copy to child issue" I believed it would work for your scenario, however I am puzzled about the trigger "Value change for Parent Link" I saw recently quite often.

Probably you can check and confirm - happy to hear some feedback.

Regards,  
Daniel

comments: author: Friedemann Wagner
body: Thanks a ton Daniel,

i somehow have the same than you have and the report even states that it worked but it does actually nothing to the lables filed:

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


author: Thorsten Boll
body: [@Daniel Ebers](/t5/user/viewprofilepage/user-id/800113) , did you actually try this? I think, there is a timing issue when using the "Issue Created" trigger. At the time, the Rule is executed, the Sub-Task is not yet fully set-up and does not know about its "Parent", thus failing to retrieve the Labels from the Parent. Any other trigger works just fine, and Labels are properly copied from the Parent.

From what I gathered, there is just no way to define a trigger like "If Parent is set" for a sub-task.

Here's proof for my claim:

![2021-07-20 14_47_44-Project automation - JIRA und 5 weitere Seiten - Thorsten @ MX ? Microsoft? Edge.png](https://community.atlassian.com/t5/image/serverpage/image-id/152045i8E1BDD8F1FE1A8F9/image-size/large?v=v2&px=999 "2021-07-20 14_47_44-Project automation - JIRA und 5 weitere Seiten - Thorsten @ MX ? Microsoft? Edge.png")


author: Daniel Ebers
body: [@Thorsten Boll](/t5/user/viewprofilepage/user-id/45499)

In my test I used a company-managed project and it worked out all fine, just re-checked the log, no timing issue or anything. In fact it copied over three labels - everything as expected.  

I could imagine in a team-managed project it might not work that way, they are structured differently.

A timing issue, because you touched that, could be remedied by a "Re-Fetch" action - but you would have to test it, I cannot reproduce it here (as pointed above).


author: Daniel Ebers
body: [@Friedemann Wagner](/t5/user/viewprofilepage/user-id/4476313)

Could you please...

... confirm if it is a team-managed or company-managed project (you can find the information when you open the projects on the left bottom)

... show what you exactly have configured for "edit action"? Does it show like this?

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

Please spot the difference that is possible here. In a previous reply to [@Lisa Grau](/t5/user/viewprofilepage/user-id/4202211) it was visible you selected "Set value" \>\>"Copy from parent"  
I'd like to ask you to use for a test "Copy from" \>\>"Parent Issue" (check the box in "Add to existing values").

Then please click "Save" - it should be then the absolutely identical rule compared with what I have in my Jira instance.


author: Thorsten Boll
body: [@Daniel Ebers](/t5/user/viewprofilepage/user-id/800113) , thanks for the reply. It's a team-managed project.

For company-managed project, we'd have went with the "post function" in the create issue transisition rather than using the new automation rules. ;-)

I tried all sorts of things, but it all comes down to the fact that the "issue created" trigger seem to trigger too early, so subsequents actions are not effective. Copying labels (or other data) works fine for any other trigger.

But, Re-fetch action does the trick though. Labels are now properly added to the Subtasks. Thanks! :)

![2021-07-22 09_03_12-Settings - JIRA und 3 weitere Seiten - Thorsten @ MX ? Microsoft? Edge Beta.png](https://community.atlassian.com/t5/image/serverpage/image-id/152310i035550C08BA9718C/image-size/large?v=v2&px=999 "2021-07-22 09_03_12-Settings - JIRA und 3 weitere Seiten - Thorsten @ MX ? Microsoft? Edge Beta.png")


author: Friedemann Wagner
body: thanks a ton [@Daniel Ebers](/t5/user/viewprofilepage/user-id/800113)

the re-fetching indeed solved the problem!


author: Curt Holley
body: If you are talking about sub-tasks of Stories, then it is the Parent, not the parent link field (which is used for the hierarchy above a Jira Epic).

You can have labels from a parent copied into its children (sub-tasks) via a post function in the workflow itself.

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


author: Friedemann Wagner
body: Thanks everyone for supporting us with the issue. We now solved it!


author: Lisa Grau
body: Hi Friedemann,

your automation should actually work, can you show me your settings in the edit issue action?

I recreated the automation like this (sorry for the german text, explanation below):

![2021-07-16 14_40_58-Project automation - Jira.png](https://community.atlassian.com/t5/image/serverpage/image-id/151678i7F5F4A33B77F4EEE/image-size/large?v=v2&px=999 "2021-07-16 14_40_58-Project automation - Jira.png")

I used the same trigger and action as you did, selected "copy value from issue" and used the parent issue (= ?bergeordneter Vorgang) as source.

It works just fine for me!

comments: author: Friedemann Wagner
body: Thanks so much for you reply.

here is my edit screen![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/151682i5A43452EB1845389/image-size/large?v=v2&px=999 "image.png")


author: Friedemann Wagner
body: is it required to see a field called "parent" within the subtask?

I couldnt find any filed like this in the configuration. All i can see is "change parent"


author: Lisa Grau
body: Okay, that works, too.

In this case I'd suggest to set the trigger to Value changes for Parent Link for \[all operations\] and not restrict it to "edit issue".

The restriction will only change the label when the sub-task is edited, but (if I got you right) you want to change the label also when the sub-task is created.

Since editing and creating are two different operations, your automation rule will only trigger when the sub task is edited after creation, not during creation. That should explain why the rule doesn't even fire.


author: Friedemann Wagner
body: mmh almost.

i have the feeling that "parent link" is not the right element? What you can see in the action log is that the action is successful but the linked issue although the parent link looks good to me![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/151701i03C4D79F1FD6E89C/image-size/large?v=v2&px=999 "image.png")

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

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


author: Lisa Grau
body: Ah, that could be.I didn't realize it's a story.

I'd suggest to either change the field "parent link" to parent, as Curt mentioned in the comment below or use the post-function he mentioned!


author: Friedemann Wagner
body: thanks again, there is no "parent" as a field. I am trying to work in prallel on the workflow change..

thanks again for all your ideas.


Tags: advanced-roadmaps

cloud

hierarchy