I need to create an automation for when I create a new issue in an existing epic.

Anna Sosnina December 28, 2023

I need a child issue custom field to be updated with the value from the epic's identical custom field value. Basically, the value in the epic for that custom field needs to be copied to the child issue on the create step.

2 answers

0 votes
Mykenna Cepek
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 28, 2023

Before proceeding, I want to restate what I think you're trying to do...

  • You have an Epic with custom field that is set to a value.
  • You want all the child issues under that Epic to have that same value for that custom field.

We also have to be aware that there are multiple ways an issue can end up as the child of an Epic. Most commonly:

  • The issue is created as a child of the Epic (example: using the + icon to the right of "Issues in epic" when viewing an Epic)
  • The "Epic Link" of an issue is set to the Epic.
  • (fellow experts: am I missing any here?)

If all of the above is correct, then it'll be easiest to implement this with two separate rules:

  • First rule:
    • Start with the "Issue created" trigger.
    • Then use an "Related issues condition" to check if the "Epic" "exists" (for the newly created issue). The rule only continues executing if that condition is true.
    • Finally use an "Edit issue" action for the custom field to "Copy from" the "Epic issue" -- and under "More options" you might want to uncheck "send emails" to reduce notifications.
  • Second rule:
    • Start with the "Field value changed" trigger set to monitor the "Epic Link" field for all changes.
    • Then use an "If/else block" condition, and add a "Related issues condition" to check if the "Epic" "exists".
      • Under that condition use an "Edit issue" action for the custom field to "Copy from" the "Epic issue" -- and under "More options" you might want to uncheck "send emails" to reduce notifications.
    • Next click on "Add else" on the left and click "Save". This adds the "Else" clause to the "If" block.
      • Under the "Else" add an "Edit issue" action to clear the custom field -- and under "More options" you might want to uncheck "send emails" to reduce notifications.

Save and publish both rules. Test them in at least these three scenarios to ensure they work as you intend:

  • New child issue created within an Epic. The custom field should get copied from the Epic to the child issue.
  • Issue not related to the Epic changed to be a child of the Epic (by setting the Epic Link field). The custom field should get copied from the Epic to the child issue.
  • Child issue of the Epic removed from the Epic (by clearing the Epic Link field). The custom field should get cleared.

A hidden assumption (using just the above two rules) is that an Epic would have the custom field set before any children were added to it.

Additional rules could be added to enforce that the custom field stays in sync between an Epic and its child issues. Some scenarios:

  • The custom field is changed in the Epic (e.g. to fix a typo). With just the above, none of the existing child issues would get updated, but new children will get the new value.
  • The custom field is changed in a child issue. With only the above rules, that will be allowed, and it might then be different from the Epic.
  • (fellow experts: any other cases to cover here?)

Additional rules can be added to address the above scenarios, if they are important for your use-case.

0 votes
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 28, 2023

Hi @Anna Sosnina , so that I might better assist, is this when the Epic is created or when the story under the epic is created? Also, do we need to b concerned about that field being updated later?

Anna Sosnina December 28, 2023

Hi @Jack Brickey , I need it for when a new issue is created under the already existing epic. If I set a field value on the epic, I need that value to be copied over to every child issue under that epic when I create those child issues. We do not need to be concerned about the field being updated later. 

Thank you for responding :) 

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 28, 2023

Try this...

IMG_3322.jpeg

obviously you will want to edit this to meet your exact needs. Basically what I present above is that when an issue is created, it simply checks to see if there is a parent and if so, it will continue and copy the custom number field from the parent to the current issue. you can add additional conditions to meet your specific needs. Let me know if I can assist further.

Anna Sosnina December 28, 2023

Thank you! I will try it and let you know how it goes. :) 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events