Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Automation - How to Set Parent Value of Story to Point to Correct Epic

Salvatore Conte
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!
March 21, 2025

Hello everyone and thank you in advance for your help. I have been using Jira for some time but am just getting into using automation. I am setting up a rule that triggers when I create an epic containing a particular text string under my current project. The goal is to create a set of "child" epics that each contain their own set of stories.

In my screenshot, I kept it simple and tried this with one "child" epic and a single story to go underneath it. What I am finding is that the story's Parent/Epic Link is linking to the original "parent" epic I manually created that triggers the rule, instead of the "child" epic. I am just learning about hierarchy, so what you see in the screenshot is what I cobbled together.

Could someone please tell me (a) how to link the story to the "child" epic, and (b) is there a simpler or more elegant way of achieving what I am looking to do? 

Also, what I would ultimately like to do is use that original epic to "hold" the other epics via Relates To links. That way someone could go to the main epic and see the sub-epics underneath it. I believe epics can't really be parents to other epics, so is there a better way of doing this? Should I just create a new issue type that would function in that way, even if it's not higher in the issue chain than an epic? If this is opening a can of worms, I can push this off for another day.

Thank you!

jira.png

1 answer

1 accepted

5 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.
March 21, 2025

Hi @Salvatore Conte -- Welcome to the Atlassian Community!

When only creating one child Story for each new Epic created in the rule, you could set the parent with the {{createdIssue}} issue smart value; that refers to the most recent one:

  • action: create issue (for the new Epic)
  • action: create issue (for the Story), setting the parent field to {{createdIssue.key}}

 

When creating multiple Stories for each new Epic, please try branching instead:

  • action: create issue (for the new Epic)
  • branch: to most recently created issue
    • action: create issue (for the Story), setting the parent field to {{issue.key}}
    • action: create issue (for another Story), setting the parent field to {{issue.key}}
    • ...
    • action: link issue to the trigger issue (for your Epic to Epic linking)
  • action: create issue (for another new Epic)
  • branch: to most recently created issue
    • ...

As shown above, you would remove the branch to current issue shown in your current rule.  And to link the new Epics to the trigger one, do that inside the branches

 

Kind regards,
Bill

Salvatore Conte
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!
March 21, 2025

Hi Bill. Thank you very much for your help. Forgive me if I misunderstood your direction as I am still facing the same issue.

Beneath the "When: Issue Created" event, which is triggered manually when an epic matching the JQL conditions are met... I tried moving the "child" epics out from my branch into the main thread of the rule. From there I have the branch coming off the main "thread" of the rule to create the two stories you see. Both stories are using the {{issue.key}} value you mentioned for their Parent field. Back to the main thread, I repeat the same pattern with a new epic by itself and two stories branched out from it.

I must be doing something wrong, because the stories continue to link to my original epic that triggers the rule, and not the new epics that precede each set of stories. Am I making a simple error with my setup? I have an updated image attached for reference. Thank you again!

jira 2.png

 

 

Salvatore Conte
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!
March 21, 2025 edited

I accidentally posted my response twice. Removed duplicate.

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 21, 2025

After creating the new Epic, the branch should be to Most recently created issue rather than to Current issue.  Please try that and re-test.

Salvatore Conte
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!
March 21, 2025

@Bill Sheboy That did the trick! Thank you very much for all of your help!

Like • Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events