Forums

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

Automation: a single rule to update all sub-tasks (stories and issues) in Epic and stories

JD_adm October 9, 2021

Currently we are using the following project structure
(stories are not being used):

 

Epic (parent)
       |_____> Issue1 (child)
       |                |_____-> Sub-Tasks of Issue1
|
       |_____> Issue2 (child)
|_____ Sub-Task_1 of Issue2
|______Sub-Task 2 of Issue2

etc.

  

 

For example,


Scenario-1: 

    If `Assignee` field of the EPIC is changed --> change `Assignee`  value in all ISSUES in this epic to be the same as the parent.

Scenario-2:
    If `Assignee` field of the ISSUE is changed --> change `Assignee` in all sub-tasks in this issue to the same value as parent.


Is it possible to have 1 rule that covers both scenarios?


Can anyone please help to create a new rule that will automate this process?


Thanks in advance!

3 answers

2 votes
Paul O
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.
October 9, 2021

You could do this by using branches for EPIC contents, and sub-tasks.

 

Screenshot 2021-10-09 at 19.32.49.png

Alex Koxaras _Relational_
Community Champion
October 9, 2021

Did you try it? Because when I did, and I change the value of an epic, the subtask branch wasn't triggered. Even if I re-fetched the data.

Paul O
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.
October 10, 2021

It won't trigger the subtask branch if you change the value of an epic, because it's not supposed to.

The requirement - as I read it - is that when the assignee is changed, the assignees one level down on the parent-child hierarchy should be updated. That's what is described in the two scenarios and that's what the automation does.

If the requirement is to cascade down the parent-child hierarchy multiple levels then  a two rule solution with the 'allow rule trigger' box checked is really the way to go - but it's not clear to me that that is what's being asked here

Like # people like this
Alex Koxaras _Relational_
Community Champion
October 10, 2021

You're right @Paul O . I misread the question. When I tried the same rule I had on my mind that the rule should change the assignee to all bow levels.

JD_adm October 16, 2021

Right, thanks for this. I suppose, it is possible to use the same rule for changing multiple values downstream? (please see the screenshot below)

What is the difference between "copy from trigger issue" and "copy from parent issue?"

how can we devise a rule that covers scenario 3?

Scenario-3: If certain value of EPIC has been changed --> change corresponding value in all downstream ISSUES  and ALL SUB-TASK in these ISSUES?

 

rule1.png

Thanks!

Paul O
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.
October 16, 2021

Yes, you can update multiple values in a single change as you've shown in your screenshot. 

In your use case, the branch is for stories in EPICs and so the "copy from trigger issue" and "copy from parent issue" produce the same outcome.  (A different use case might, for example, copy data between tasks or stories that do not share the same parent and so you'd need to use "copy form trigger issue")

The automation I posted does NOT support scenario 3 - it only works to cascade a field setting one level down the hierarchy (Epic to Story/Task OR Story/Task to sub task). I'd always go with a two rule solution to cascade a value from Epic -> Story -> Sub Task, but you should check out @JD_adm  and @Bill Sheboy 's suggestions if you'd like to tackle it as a single rule

Nolan McConnell
Contributor
March 9, 2023

I'm running into a similar issue here and can't solve it. I have a custom issue type "idm automation" that when I update the parent issue field "start date" it doesn't filter down to the sub-tasks. Right now it actually erases the sub-task from the jira automation bot. 

 

Any help greatly appreciated. 

 

yes, I know it's currently disabled :) 

 

Screen Shot 2023-03-09 at 3.51.26 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.
March 9, 2023

Hi @Nolan McConnell 

What do you mean by "erases the sub-task from the jira automation bot"?

Do you mean the Start Date field in the sub-task is cleared rather than set from its parent issue?  If so, please post an image of your Edit Issue action.  I believe what you want to use for that rule is "Copy from Trigger Issue" for the field value to copy.

Kind regards,
Bill

Nolan McConnell
Contributor
March 10, 2023

@Bill Thanks, Bill. I am currently using the following. Screen Shot 2023-03-10 at 11.44.49 AM.png

I just realized the 3 dots to the right of the line and the "copy" option. Will try. 

Nolan McConnell
Contributor
March 10, 2023

Do I need to add the "for stories" above this "for Sub-tasks"? I'm using a custom issue type so I'm not sure if it'll work. 

Nolan McConnell
Contributor
March 10, 2023

Just tried the above screenshot with the "copy from current issue" in there as well as adding the step above sub tasks for stories and it didn't work. 

 

Screen Shot 2023-03-10 at 11.50.10 AM.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.
March 10, 2023

Please try instead to use "Copy from Trigger Issue", if that is the source you want.

When you use "Copy from Current Issue" in an edit that will try to copy the value from itself.  This option is typically used when creating a new issue, not an edit.

1 vote
Alex Koxaras _Relational_
Community Champion
October 9, 2021

Hi @JD_adm 

Editing my answer due to misreading your question. First of all, you could implement Paul's solution. This will work for you. However, if you want to by changing an Epic's assignee, all sub-issues and their corresponding subtasks to inherit this new assignee, then:

  • Create a custom field which will store on the subissues and their subtasks the Epic link (since epic link is valid only for subissues)
  • Then on the automation rule use branch rule for a JQL and set this field to be equal with the key of the issue that trigger the event
  • The above will bring you all subissues and their subtasks, and you may change the assignee to all of them.

Let me know if this is clear.

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.
October 11, 2021

Hi @Alex Koxaras _Relational_ 

Another way to do this without the custom field is with a created variable and lookup issues: gather the keys of the issue you want to update using repeated lookups and variable updates to build a CSV list, and then use a single branch on JQL to update the assignees at once.

Both approaches (custom field and created variable) have the possible limitation of running into the 100 issues processing limit, so "buyer beware".  :^)

Kind regards,
Bill

Alex Koxaras _Relational_
Community Champion
October 11, 2021

Nice @Bill Sheboy! To be honest, I didn't even think of that solution! Maybe I'll give it a go :)

JD_adm October 16, 2021

@Alex Koxaras _Relational_thanks. Would this solution work if we are changing multiple EPIC values, e.g. Security Level, Assignee, Reporter, Due Date, etc. ?

when you are in the mood, could you please share a screenshot or an example of this rule? Not sure if I am getting it 100% right.



Alex Koxaras _Relational_
Community Champion
October 17, 2021

@JD_adm hi!

Yes this rule could work for as many field changes you want to make.

Concerning the screenshot, I can't share something, because I haven't created the rule. My advice, if you want to learn about jira automation, is to do it yourself and experiment. The basic idea is what I've described in my previous post. If you follow this, you will succeed!

0 votes
Michael Leak July 30, 2023

Hi there, how do I set an automation to populate sub-tasks label field with the same value as the label in the parent (story/bug) where the label field is required? Thanks

Suggest an answer

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

Atlassian Community Events