How can I create a Jira automation rule to generate multiple stories and their subtasks in a specifi

Samson S
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!
December 4, 2024

I need help setting up a Jira automation rule. Could you please provide step-by-step instructions to achieve the following?

When I create an Epic, I want it to automatically generate Stories and their associated Subtasks. For now, I’m fine with a manual trigger, but eventually, I’d like to fully automate the process so that the following actions occur upon Epic creation:

On Epic creation, the automation should create:

  • Story 1: Summary: Do this
    • Subtask 1: Update this document
    • Subtask 2: Update that document
  • Story 2: Summary: Do that
    • Subtask 1: Update this form
    • Subtask 2: Update that form
  • Story 3: Summary: Conclude
    • Subtask 1: Update this survey
    • Subtask 2: Update that survey

There are a total of 15 Stories, each with their own specific set of Subtasks. It is crucial that the Subtasks are created in the exact order I’ve outlined.

Could you please guide me on how to set up a Jira automation rule to accomplish this?

3 answers

1 accepted

0 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.
December 4, 2024

Hello @Samson S 

Welcome to the Atlassian community.

How many subtasks will you need to create in total?

When you say it is crucial that the subtasks be created in the specified order, do you mean ordering just within their parent issue?

What type of Jira subscription do you have? There are limits to how many rule executions you can have per month based on the type of subscription. That could impact our advice about how to structure the rule(s).

Samson S
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!
December 4, 2024

Hi , thank you for the response! First time figuring out automation so appreciate the support. 

iI have the JIRA premium version. Here's an example , when i create an epic , i should generate : 

 

1. Story with 5 Subtasks

Story: Onboarding a new client to the system

  • Subtask 1: Create a new client profile in the CRM system.
  • Subtask 2: Set up initial user accounts and access permissions.
  • Subtask 3: Send welcome email with onboarding instructions.
  • Subtask 4: Schedule an introductory training session.
  • Subtask 5: Verify successful login and system access with the client.

2. Story with 10 Subtasks

Story: Deploying a new software feature

  • Subtask 1: Review and finalize functional requirements with the Product Owner.
  • Subtask 2: Create development branch in the repository.
  • Subtask 3: Develop the feature as per the specifications.
  • Subtask 4: Conduct unit testing on the feature.
  • Subtask 5: Prepare a test case for QA validation.
  • Subtask 6: Perform integration testing in the staging environment.
  • Subtask 7: Deploy the feature to the staging server.
  • Subtask 8: Notify stakeholders for user acceptance testing (UAT).
  • Subtask 9: Fix issues identified during UAT and retest.
  • Subtask 10: Deploy the feature to the production environment and confirm successful implementation.

 

I need to have the subtasks in the order specified. I do not have any screenshots of what I have right now as I have been trying dfferent approaches and have deleted the rules with the intention of starting from scratch when I realised I could also ask for some help from the community. 


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.
December 4, 2024

My recommendation would be to create multiple rules.

Rule #1: When the Epic is created
If needed, have a condition to check if this is an Epic where the stories should be created.
Have a Create Issue action for each of the 15 Stories.
In each story add a unique identifier; i.e. a label, or a very unique keyword or code in the summary

Rule #2: When Story is created
Have a condition to check for keyword that matches Story 1
Optionally have an Edit Issue action to edit the story to remove the keyword
Have 1..n Create Issue actions to create the subtasks for Story 1

Rule #3: When Story is created
Have a condition to check for keyword that matches Story 2
Optionally have an Edit Issue action to edit the story to remove the keyword
Have 1..n Create Issue actions to create the subtasks for Story 2

Rules 4 through 16 for the remaining 12 Stories that you created in Rule #1

 

The reason I recommend this approach is:

  1. It appears that each subtask is going to need unique information.
  2. Rules are limited to 65 components (actions, conditions, and branches). It looks like there is a risk that you have so many subtasks to create that they could not all be created for all stories within a single rule.

    You could combine a few of the individual Story Subtask creation rules, and use the IF/ELSE condition to check for "If the Story has keyword 1 then create subtasks for story 1, ELSE if the Story has keyword 2 then create subtasks for story 2, etc."
Samson S
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!
December 4, 2024

Thanks @Trudy Claspill ! I tried these steps initially with limited tasks but it seems the rule i have tries to attach the subtasks to the epic instead of the relevant story that matches the label. 

Here's what I have created : 

 

Rule 1 :  to create the stories part of the epic

When issue created

Issue fields condition

- issue type = epic

Then create new issue :

- issue type : story

- summary : story 1

- Parent : trigger issue

- Labels : T1

 

Then create new issue :

- issue type : story

- summary : story 2

- Parent : trigger issue

- Labels : T2

 

 

Rule 2 : create subtask for story 1

When issue created

Refetch issue data

Issue fields condition :

- issue type = story

Issue fields condition :

- labels = T1

Then create a new

- issue type : subtask

- parent issue : current issue

- summary : subtask 1

And create a new

- issue type : subtask

- parent issue : current issue

- summary : subtask 2

And create a new

- issue type : subtask

- parent issue : current issue

- summary : subtask 3

And create a new

- issue type : subtask

- parent issue : current issue

- summary : subtask 4

 

Outcome : the stories are created for the epic but I do not see any subtasks. Audit log . (ID-266 is the epic)

Action details:
Re-fetch issue data
Issue data re-fetched from server successfully.
Issue condition
The following issues did not match the condition:
ID-266

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.
December 4, 2024

Hello @Samson S 

Is it correct that the audit log output you showed is for rule #2?

This output is correct in that it is triggered by the creation of an issue, in this case the creation of the Epic. And when it says "The following issues did not match the condition" that is also correct because the issue type is Epic and the condition checks that the issue type is Story in Rule #2.

On Rule #2 on the Rule Details page make sure that you check this box:

Screenshot 2024-12-04 at 7.34.27 AM.png

Since it is a rule that is created the Story issues, this box needs to be checked. That will enable the Subtask creation rule to be triggered by issues that are created through the execution of another rule vs. issues created manually through the UI.

Samson S
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!
December 4, 2024

It works! Thanks @Trudy Claspill  . I had not checked the box in rule # 2. Works like a charm now. Appreciate the time you took to resolve this issue . I learned something new today :) 

0 votes
Klaudia Schön_Deviniti_
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 4, 2024

Hi @Samson S

I know you mentioned about the automation but have you considered using 3rd party app for templating? It can be more user friendly and doesn't require to be familiar with writing any code. 

From my side, I'd like to recommend you our solution: Issue Templates for Jira app. On this page: https://deviniti.com/support/product/issue-templates-cloud/ you may find a video recording or clickable tutorial regarding this one, I'm sure you will find it useful! 

Klaudia from Deviniti :) 

0 votes
Marc - Devoteam
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 4, 2024

Hi @Samson S 

Whenever you ask for help with an Automation Rule it will help us to help you if you provide:

1. screen images that show your entire rule.

2. screen images showing the details of the step(s) that aren't generating the result you expect.

3.screen images showing the Audit Log details for the rule execution.

4.screen images showing the relevant data in an image that is part of the rule execution.

Suggest an answer

Log in or Sign up to answer