Automation - Create Epic, Stories and Sub-tasks

Morris Coyle
Contributor
September 13, 2021

Hi All,

I am trying to create an Epic, a couple of stories one of which will have a number of sub-tasks. However I cannot seem to get the right combination of branching/logic etc. to do this. I can create an EPIC, create a Story linked to that Epic but every time I try and create the sub-tasks they appear as sub-tasks of the Epic not the story.  Anyone able to help with this please?   This is what I currently have after tearing it all up and starting again.

 

 

2 answers

1 accepted

4 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.
September 13, 2021

Hi @Morris Coyle 

If I understand your question, you are trying to create an epic, its stories, and their sub-tasks together.  If that is correct, there are at least two ways to do this: 1 or 2 rules:

  • 1 rule: use conditions and branches to manage the creations.
    • trigger: let's assume manual
    • action: create issue for the epic
    • branch: on JQL with key = {{createdIssue.key}}
      • action: create a story
      • action: create a story
      • ...
    • branch: on created issues option again
      • condition: issue type is story
      • action: create sub-tasks
  • 2 rules: create the epic/stories in one rule and the sub-tasks in another
    • rule-A: create the epic, and when creating the stories add some field value to check
    • rule-B: triggered on issue created, check the condition for the field value you set in rule-A, and then create the sub-tasks.  Please note: in rule-B, select the option "Allow rule trigger" in the details so the first rule can fire the second one.

I personally recommend the 2-rule option, as branches execute asynchronously and so I would be concerned about timing errors.

Kind regards,
Bill

Morris Coyle
Contributor
September 14, 2021

Thanks for that Bill, much appreciated.  I went with the 2 rules approach which worked really well. Kicking myself for not thinking of that myself sooner.

Like # people like this
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 14, 2021

I am glad to learn that helped.  Please consider marking this question as answered; that will help others in the community with similar ones find solutions faster.  Thanks!

Marc Isikoff
Contributor
September 27, 2022

Could I get a little more clarity on how this works?

My scenario is I get a person inputted into Jira Service Management from the requestor. This person can be in a pool of people like A, B, C so currently I can do branch for current issue and if/then to create an Epic into an appropriate Jira Project based on A, B, C and that works. Epic is created.

However, I also want to create 1 story as well tied to the Epic. Option 1 looks closest for what I want to do.

Running into an issue branching on JQL = JQL with key = {{createdIssue.key}} whereby it does nothing underneath that (e.g., doesn't create the story).

For the Epic I create it's easy to get values like {{issue.field}} for the Epic, but when it's time for the Story not sure what to do with 'key' as the scope of the Story should come from the Epic or the JSM issue so unsure which I can refer to. Also need to know how to link to the Epic.

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 27, 2022

Hi @Marc Isikoff 

I recommend creating a new question for this and including a link to this thread.  Otherwise only the people following this older thread will see it.

When you post the question, please post images of your rule and the audit log details showing the execution.  That will provide context for the community to offer ideas.  Thanks!

Kind regards,
Bill

Marc Isikoff
Contributor
September 27, 2022

Thanks Bill, already solved this one from another post.

 


{{#createdIssues}}{{key}}{{/}} should be in Epic Link from Story if created just after the Epic

Like Bill Sheboy likes this
Marc Isikoff
Contributor
October 28, 2022

Unfortunately if want to create 2 stories under an Epic the solution does not work for 2nd story, just the first as #createdIssues changes with each.

I need to create 1 epic, 5 stories, and 3 sub-tasks under one of those stories and of course, only Jira Cloud has ability to create a variable to thread them all. :(

0 votes
Kush Asawa May 28, 2024

@Morris Coyle Hi Morris,
Do you mind sharing the screenshot of your automation rule?

Suggest an answer

Log in or Sign up to answer