I want to create an automation that does the following
1. Create Epic 1 with parent link as Initiative 1
2. Create Epic 2 with parent link as Initiative 1
3. Create Epic 3 with parent link as Initiative 1
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?
I ended up creating three rules. One to create the 2 epics and the following two to make tasks for each of those epics.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 rule...as long as it wasn't inside of a branch.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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?
@[deleted] 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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
https://confluence.atlassian.com/automation/lists-993924868.html
...something like {{createdIssues.get(0)}} should return the Epic Link value for your first set of Tasks. Increment the number for each successive Epic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Totally makes sense, @Bill Sheboy. I had two (unconfirmed) concerns with this approach:
I think we're both interested in hearing what eventually worked for @Julia !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Thanks,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.