Advanced Branching: For Each Smart Value Create a new Story and the subtasks

Brian Eschen July 19, 2021

I'm using an advanced branch to create a new Story for each label added to an Epic but am unable to then also create the Sub-tasks to go with each Story. 

It seems I'm unable to add a Branch rule / related issues component inside of the Smart Value Branch.  If I could move the last branch under the "Then: Create a new Story" this automation would work perfectly.

 

Screen Shot 2021-07-19 at 5.43.19 PM.png

I get this error in my audit log

Can't branch rule as it requires issues to have been previously created by this rule. More than likely you have not yet created an issue or the issue(s) were created in an another 'If' block or branch - these would then not be visible outside of that block/branch.

4 answers

1 accepted

1 vote
Answer accepted
Joy Chiu
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 19, 2021

Hi @Brian Eschen 

This is a known issue: AUT-247 . In "For All created issues" branch, it cannot get the issues created in "For each" branch.

Cheers,

Joy [Automation for Jira]

1 vote
Curtis da Costa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 28, 2022

@Brian Eschen If you click and drag a branch before you specify whether it's an "Advanced branching" or "Branch rule / related issues" component (i.e., while it is just a purple block that says "New branch"), you're able to nest it inside other branches. Jira nested branches.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.
September 28, 2022

Hi @Curtis da Costa 

How much have you tested that structure?

I am asking because...

  • that branch on "current issue" isn't really a branch; it gets executed inline,
  • I have seen other posts from Atlassian folks that nested branches are not supported, and
  • as branches execute in parallel and asynchronously, I wonder if the results of that structure would be unpredictable. 

Kind regards,
Bill

Curtis da Costa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 28, 2022

@Bill Sheboy I was thinking it would likely be unpredictable as well as everyone seems to be saying it's unsupported.  I've played around with a single nested branch and it solved an issue I was having that was (somewhat, but not really) similar to OPs (I had a "For Sub-tasks" branch nested in a "For Destination issue" branch).  I haven't tested his exact application, but thought it may be useful for him to try it out.

Like # people like this
John
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2023

Thanks @Curtis da Costa !  Working for me in a similar rule.

0 votes
Daniel Ebers
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 21, 2021

Hi @Brian Eschen

wanting to see the results I gave it a try - it worked for a company-managed project, however I feel sceptical about the implementation because there is no usage of any advanced features. It is so simple that there might be something missing, in case you would like to check and compare it would be appreciated.

grafik.png

For an Epic labeled with "Test" upon manual run of the rule a new Story will be created.
In this Story a Sub-Task will be created. Then the "Test"-label is removed from the issue (to prevent endless-loops) - in accordance to what @Bill Sheboy suggested.
In the next step my intention was to try the JQL-approach Bill suggested but before doing so it turned out the rule seems to work like shown above - anyway, please check :)

Regards,
Daniel

0 votes
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 21, 2021

Hi @Brian Eschen 

I haven't had a lot of success with the related issues branches.  My work-around is to use JQL branches to re-create what the related issues would have returned.  Perhaps give that a try.

Best regards,
Bill

Brian Eschen July 21, 2021

Hi @Bill Sheboy Do you have some examples handy? I haven't tried anything like that before.

Thank you!

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 21, 2021

Not really, as each case is often different. 

Let's assume you uniquely identify your newly created stories (based upon the epic labels) with a value in their own labels, such as "Needs_Subtasks".  Your next piece of the rule would be:

  • branch: on JQL of project=myProject AND labels = Needs_Subtasks AND... any other criteria you needed, such as comparing to the trigger issue (epic) as parent/epic link
    • action: add sub-tasks
    • action: edit issue to clear the Needs_Subtasks from the labels

That last edit is the stopping condition, so the same issues do not repeatedly get more sub-tasks added later.

Suggest an answer

Log in or Sign up to answer