Rule to Edit a field value for all Stories and Sub-Tasks when changed in the Epic

Dillon Scicluna January 19, 2023

I need to create an automation for when a field value is changed in the Epic, all Stories and Sub-tasks under that Epic edit that specific field's value similar to the Epic's.

With regards to stories, I managed to make it work automatically for both Scheduled changes and Field Value changes.

 Screenshot_20230119_100020.png

However, when it comes to Sub-Tasks, I only managed to run the rule for the Value change independently from the Story rule (i.e. When both Story and Sub-Task rules run one after the other, only the Story automation works while the Sub-Task automation field value remains as it was). Also, which is very strange, unlike the Value change automation, the rule does not work when it is Scheduled for Sub-Tasks.

Screenshot_20230119_102631.pngScreenshot_20230119_102653.png

What can I be doing wrong when it comes to the Sub-Task automations?

2 answers

1 accepted

2 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 19, 2023

Hello @Dillon Scicluna 

Welcome to the Atlassian community!

You can use a rule like this (substitute your field where I used Fix Versions).

Screen Shot 2023-01-19 at 10.51.33 AM.png

The first half of the rule will run to update the Stories when the Epic is updated. The second half of the rule will be run as a separate invocation of the rule based on the Stories having been updated.

On the Rule Details page you need to check the box for Allow rule trigger.

In the Edit Issue Fields components you need to use the Copy value from Trigger issue option.

Screen Shot 2023-01-19 at 10.54.17 AM.png

Dillon Scicluna January 20, 2023

Thanks for your help @Trudy Claspill !!

The Allow rule trigger check was the solution I needed. However, I still had to create 2 automations for the rule to run on a Schedule instead of a Field Value change.

 

Screenshot_20230120_095532.png

Dillon Scicluna January 20, 2023

@Trudy Claspill I updated the automation to run on a schedule instead of a field value change however, the sub-task part is not being updated for whatever reason. I tried with 1 Automation, and 2 automations for each: stories and subtasks (Setting the 2nd schedule slightly after just in case the fields do not change quick enough). What could the issue be, please?

Screenshot_20230120_151158.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2023

Your original post says the requirement is "when a field value is changed in the Epic,". Why are you using a Schedule trigger instead of a Field Change trigger?

If the requirement is to do this on a Schedule, I would assume you are including a JQL in your Schedule trigger(s). Please share those details.

Dillon Scicluna January 23, 2023

I need it to run on a schedule so when someone changes the value of a sub-task without updating the Epic and Story, it automatically changes back to the field's value in the Epic everyday.

JQL: issuetype = Epic AND status not in (Archived, Closed, Done, Failed, Rejected, Resolved, Successful) AND "CAPEX[Dropdown]" IN ("Yes", "No")

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 23, 2023

With the JQL in your filter the rest of the actions in your automation rule will be applied to the Epics the JQL retrieves.

The first half of your automation will be looking for child issues of the Epics.

The second half of your automation will be looking for Subtasks connected directly to the Epics, not to the child issues of the Epic.

You will indeed have to split it into two scheduled rules to change the child issues in one rule and the subtasks of the child issues in a separate rule. 

You said you tried creating two rules, but the rule for Subtasks didn't change the subtasks. Your rule for the Subtasks will need a different JQL to select the child issues for which Subtasks need to be updated. What did you use for the filter on that rule?

Native JQL does not support selecting child issues of Epics based on a filter being applied to the Epics. Do you have any JQL extending third party apps available to you, or is it possible for you to add such to your system? If you do then it might be possible to use one of the features from that app to essentially say:

"give me all the child issues of epics that match this filter..."

...and provide the filter used in your first rule. If you don't have such apps, then the filter will need to be something different, like selecting the issues based on the Updated date/time being within the timeframe between the running of the first rule and the trigger of your second rule:

updated > -15m and issuetype not in (Epic, subTaskIssueTypes())
0 votes
Andrea Pareja April 19, 2024

Hi, 

I'm trying to use this rule, but the field I want to use does not have the options 'Copy from Epic, Copy from Parent. Its type is Select List(Single), so it just allows me to select from one of the defined options. 

Do you know any other way to use the option selected in the epic to populate all child issues?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 19, 2024

Hello @Andrea Pareja 

A Select List (Single) should have that option available.

Did you click on the ... button next to the field and select COPY?

Screenshot 2024-04-19 at 12.26.33 PM.png

Then click on the displayed text to get the pop-up.

Screenshot 2024-04-19 at 12.28.47 PM.png

Then pull-down the Issue to copy value from field and select Parent

Screenshot 2024-04-19 at 12.29.29 PM.png

Suggest an answer

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

Atlassian Community Events