Use JIRA automation to create epic with issues

Malvina Garnier December 30, 2021

I set up a JIRA Automation rule in order to automatically create epic & issues when some personalized fields are filled. Please see below the rule. 

On the else / if part of the rule, I create first an epic and then a ticket. I would like this ticket to have the previous created epic as epic link. How could I do so ?

02e7f2a5-fa09-4ccd-b00e-87899ca2a7f4.png

5 answers

1 accepted

7 votes
Answer accepted
Malvina Garnier December 30, 2021

I finally found a solution šŸ‘

463bf602-91b8-4fc2-b27d-9f61046e2cdb.png

Jeff Pittman October 20, 2022

EUREKA!!!!!

Like ā€¢ Naji MELHAOUI likes this
0 votes
Shilin Zheng March 9, 2023

Hi, following the guide by @Malvina Garnier I am able to set up the rules, however, what if I want the first created issue to be under the epic created after, how should I do it? It seems I cannot just edit the issue type to 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.
March 9, 2023

Hi @Shilin Zheng 

Would you please clarify what you are trying to accomplish?

  1. Create an issue like a story, create an epic, and then link the first issue as a child of the epic
  2. Change the type of a created issue in a rule
  3. Something else?

If you want to do the second one (i.e., issue type change, I would recommend not doing so.  Changing the type of an issue has a lot of checks/validation involved.  This is why Jira has a specific feature to support doing this with the UX: the Move function.

Kind regards,
Bill

Shilin Zheng March 10, 2023

I see. Yes I tried variant 2 but failed. 

Here is what I need: I first create a task, and if the task meets a certain condition, I'd like it to be "updated" to an epic. Since you said this is not recommended, so instead, I set it to automatically create an epic, after the epic is created, several other tasks will be created automatically too. However, in this case, how can I make the triggering task under the newly created epic too? 

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

Thanks for that information.

Are you also asking: how can I link the triggering issue to the epic I created in the rule?

If so, you can do this by referencing the {{createdIssue.key}} to edit the trigger issue's epic link.  And, I recommend posting an image of your complete rule; that will provide context to confirm if that will help your scenario.

Shilin Zheng March 10, 2023

Yes, that is what I would like to set. Here is my automation rule

Screenshot 2023-03-11 030501.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

To make the trigger issue a child of the new epic, you will need to save the epic key and edit the trigger issue after your branch.  I bolded the new sections, as shown below.

  • trigger: issue created
  • action: re-fetch issue
  • condition: issue type is...
  • action: create a new Epic
  • action: create variable
    • name: varEpicKey
    • smart value: {{createdIssue.key}}
  • branch: for most recently created issue
    • ...your logic to add the new tasks
  • action: edit issue (this will edit the trigger issue)
    • for the epic key, enter the created variable name {{varEpicKey}}
Like ā€¢ luis.rossi likes this
0 votes
Antonio Rivera January 24, 2022

Hello @Malvina Garnier

Were you able to make this work? I'm looking to implement the exact same thing and would really appreciate some help!

 

Thanks!

Malvina Garnier April 5, 2022

Hi Antonio, 

Sorry for the late answer but yes, I do. See my last comment for the solution ;) 

0 votes
Jack Brickey
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 30, 2021

Hi @Malvina Garnier , if you are asking how to create an epic and underlying stories within an automation rule there are a number of existing posts that could help. I found this one with a quick search that might help - Automation-Set-Epic-Link-on-Story-to-Epic-created-in-the-same-automation  

if Iā€™m missing the mark please LMK. 

Jack Brickey
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 30, 2021

In looking at your screenshot I think the key piece you are missing is the Branch component once epic is created.

Malvina Garnier December 30, 2021

Hi Jack. Thanks for your answer. I'm really sorry but, I took a look on the post you advice me to check and I tried to reproduce what is done but I may do something wrong and it still doesn't work :'( 

Jack Brickey
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 30, 2021

Yep as your solution depicts the branch component is the key.

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.
December 30, 2021

Hi @Malvina Garnier 

Yes, and...to what Jack describes:

One alternative to using the branch on recently created issue is to instead set the epic link to most recently created issue's key directly: {{createdIssue.key}}

Kind regards,
Bill

0 votes
Malvina Garnier December 30, 2021

I tried different option but no one works. Maybe I should you the 'More options' field ? Hope I will find help here :) 

Suggest an answer

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

Atlassian Community Events