Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How can I create multiple epics each with their own tasks associated in one rule?

I want to create an automation that does the following

1. Create Epic 1 with parent link as Initiative 1

  • Task with Epic 1 as parent 

2. Create Epic 2 with parent link as Initiative 1

  • Task with Epic 2 as parent 

3. Create Epic 3 with parent link as Initiative 1

  • Task with Epic 3 as parent  

I already know how to make the Epics & correctly link them to the initiative by using: 

"fields": {
"Parent Link": "{{triggerissue.key}}"


How can I make the Tasks have their Epic Links be as defined above? 

2 answers

1 accepted

1 vote
Answer accepted

I ended up creating three rules. One to create the 2 epics and the following two to make tasks for each of those epics.

0 votes
Mykenna Cepek Community Leader Oct 20, 2021

Just create the first Epic, and save that issue off in a variable from the {{createdIssue}} smart value:

Then create the first Task under that Epic, and use the saved variable to set the "Epic Link" field. This can be done in the GUI, no JSON needed.

Rinse and repeat!

Hi @Mykenna Cepek and @Julia 

I think that when you add the task, you can just set the "Epic Link" to {{createdIssue.key}} without the created variable, as that will contain the last created one in the long as it wasn't inside of a branch.

Kind regards,

@Mykenna Cepek When you say "save that issue off in a variable" how can I do that? I know how to call {{createdissue}} but how do I do that for each epic and save them uniquely? 


@Bill Sheboy would that solution confuse the automation since the last created issue for some of the tasks would be a preceding task? 

for example:

Epic 1: 

  • Task 1 with epic link as {{createdIssue.key}} would work fine
  • Task 2 with epic link as {{CreatedIssue.key}} would the automation try to use Task 1 since it was created the most recently ?
Mykenna Cepek Community Leader Oct 20, 2021

@Julia You're concern about the last created issue being replaced by the most recently created Task is valid. This is why I suggested saving it in a variable.

To create a variable, just use the "Create Variable" action:

Basically you just make up a variable name (like "LatestEpic") and fill in {{createdIssue}} for the Smart Value. That variable will hold the value you set.

Then use {{LatestEpic}} when setting the "Epic Link" field for each new Task.

Once you've processed the first Epic and all it's Tasks, then create the second Epic, and use that same "Create Variable" action again (with identical parameters). This will update the variable to relate to the second Epic.

And so on!

Oh no! That would work perfectly, but I'm on Jira Server and that option isn't available. Thank you for the suggestion, I wish I could use it. 

@Mykenna Cepek 

Mykenna Cepek Community Leader Oct 20, 2021

Hmm. Ok, plan B...

There is a smart value called {{createdIssues}} -- plural. Apparently it aggregates a list of all the issues created in this rule. So...

Create all the Epics first. At this point, I would expect the {{createdIssues}} smart value to be a list of all those Epics.

Then create each Task, and use a smart value list function to pull out the appropriate Epic from {{createdIssues}} when setting the "Epic Link" field in each Task.

According to the Jira Server docs for Automation and smart value list operations...

...something like {{createdIssues.get(0)}} should return the Epic Link value for your first set of Tasks. Increment the number for each successive Epic.

Like Bill Sheboy likes this


Thank you! Let me try this and let you know if it works.

Like Bill Sheboy likes this

Hi, and sorry I am catching up on the thread.  :^)

My understanding of {{createdIssue}} singular is that it *always* contains the information from the most recently created issue in the rule...With one exception: there is a by-design behavior that this can get "lost" when issues are created in a branch.  (Branches of more than one thing fire off independently of the rule, and so there is no guarantee when they finish.)

So, I was proposing a variation of what @Mykenna Cepek noted using {{createdIssues}} plural.  One at a time would be:

  • created an epic
  • create a task linked to the most recent epic using {{createdIssue.key}}
  • created an epic
  • create a task linked to the most recent epic using {{createdIssue.key}}
  • ...

Totally makes sense, @Bill Sheboy. I had two (unconfirmed) concerns with this approach:

  • I assumed a need to (at least sometimes) create multiple Tasks under each Epic. Upon review, that wasn't explicitly stated in the OP. Might end up being a "subtle brittleness" that would misbehave if a second Task was added.
  • I wasn't confident about the value of {{createdIssue}} during a "Create Issue" action, and didn't have time to verify that it would be the previously (not currently) created issue.

I think we're both interested in hearing what eventually worked for @Julia ! 

Like # people like this

Hi @Julia 

Just following up to learn if you resolved this one.  If so, would you please mark it as answered?  That will help others in the future find solutions faster.  


Suggest an answer

Log in or Sign up to answer

Atlassian Community Events