Copy field value from Epic to child issue with automation

Huey van Zijl July 2, 2020

There are couple fields in child issues that mostly match the parent issue, but sometimes need to be changed. For easy implementing I would like to copy the Epic values upon creating the child issue. I tried using 'Automation' in different configurations but I can't get it to work. It say's 'Succes' but the fields in the new issue don't reflect the fields in the Epic.

Schermafbeelding 2020-07-02 om 11.40.55.png

 

This is the current exported rule:

 

Schermafbeelding 2020-07-06 om 18.18.16.png

Thank you for taking your time to help me with this issue!

3 answers

1 accepted

5 votes
Answer accepted
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.
July 2, 2020

Hi @Huey van Zijl 

Would you please post images of your rule definition?  That will help the community try to answer your question. 

Your custom fields are different from those defined in other people's instances, so importing the rule's JSON may not help others understand your rule.

Best regards,

Bill

Huey van Zijl July 6, 2020

Hi Bill,

Thank you so much for replying so soon! I've updated the original post. :)

- Huey

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.
July 6, 2020

Hi Huey,

Thanks for the additional information.  Three next steps to try:

  • After the trigger, add a condition to test if there is an epic link.  This could be a timing issue, or perhaps the issue doesn't have an epic.
  • Your image shows the rule in draft status.  Is that just from viewing it, or are there un-published changes to save/publish?
  • Next, before your copy action, add a branch on the epic to add a comment including the parent's values of those fields.  That will confirm they are indeed what you expect prior to the copy.

Best regards,

Bill

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.
July 7, 2020

Hi @Huey van Zijl 

An update: another community member saw a similar issue with the edit/copy not working.  They solved that by adding a re-fetch action to solve a potential timing problem where the created issue does not yet have the parent link.

So, your updated rule would be:

  • Trigger: issue created
  • Action: re-fetch the issue
  • Condition: confirm the issue has an epic link (not empty)
  • Action: edit issue to copy the parent epic's fields
Like # people like this
Huey van Zijl July 7, 2020

Hi @Bill Sheboy ,

 

Thank you so much for helping me, your advice did the trick! For anyone searching the forums here is my implemented solution:

 

20200707 Jira automation copy epic values to new child issue.PNG

Tip: be sure to configure the last step 'Then: Edit issue fields" correctly by telling it to copy from epic. :) 

Like # people like this
Morris Coyle September 26, 2022

Just wanted to say thanks to @[deleted] for this answer.  Worked perfectly first time and saved me the time having to figure it out

Like Bill Sheboy likes this
j j January 2, 2024

I have a question, you said on your tip to' Then: Edit issue fields" correctly by telling it to copy from epic.  How do you do this? I simple used the format you pasted above. is there another step that is not visible on the screenshot?

Like Federico Diterlizzi likes this
0 votes
Brellison December 15, 2021

I have this automation running and it works when an issue is created; however is there a way to get this to trigger when the field value changes on the Epic and it copies the the new field value to all child issues (tasks/stories)?Screen Shot 2021-12-15 at 12.05.16 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.
December 15, 2021

Hi @Brellison -- Welcome to the Atlassian Community!

First thing: please consider creating a new question, and perhaps linking to related ones.  That will ensure more people see it...only the people currently following this thread will see it otherwise.

On to your questions...

The rule you show is triggered on a field value change, not issue create.  Are you certain that triggers on create as you noted?

Next, you should be able to detect the change in the epic and then copy that down to its child issues.  For example:

  • trigger: field changes
  • condition: issue type is epic
  • branch: on the epic's child issues
    • action: edit the field, copying from the trigger issue

Please also see the template library for other example rules like this: https://www.atlassian.com/software/jira/automation-template-library#/

Kind regards,
Bill

Like # people like this
Brellison December 15, 2021

Thanks for your help Bill! Your solution helped.

 

For clarification, I had the original rule in this thread running fine, but found a limitation in it that when the Epic's fields were updated, the existing issues' fields did not update to reflect the new value. But the automation you provided me fixes that.

Like Bill Sheboy likes this
Arnav April 15, 2022

Hi ,

I have tried the same .but it is copying from parent to child .but not child to grand child.any suggestions?

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.
April 15, 2022

Hi @Arnav 

Please consider creating a new question, and perhaps linking to related ones.  That will ensure more people see it...only the people currently following this thread will see it otherwise.

Regarding what you asked about...

Are you using Jira Cloud or Server/Data Center version?

If on Cloud, what is your project type: Company-managed or Team-managed?

When you note you tried the same thing, what do you mean?  Would you please post images of your complete rule and audit log details, showing the execution which does not work as you expect?  That will provide context for the community to offer help.  Thanks!

Kind regards,
Bill

Arnav April 18, 2022

Auto propogate image.PNG

Arnav April 18, 2022

I am using jira cloud and Project type is Company managed

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.
April 18, 2022

Thanks @Arnav 

Currently, nesting of branches is not possible, so you would need 2 rules.  The only differences between the rules are the conditions and the branches.

  1. When label changes for an epic issue type, copy the values to the child issues (story/task/bug issue types)
  2. When label changes for a child issue type, copy the values to the grandchildren (subtask issue types)

Rule #1 can trigger rule #2, so in the detail settings for Rule #2 you may enable the "Allow Rule Trigger" option to make this work.

0 votes
jhuddles December 14, 2020

Error

Suggest an answer

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

Atlassian Community Events