How to lookup an Epic ID linked to a parent story in Jira Automation

Deleted user December 17, 2020

I'm trying to create an automation as such:

 

When a Test issue type is created, look at the linked Story issue type and determine the Epic associated with that Story.  Once it gets that Epic, add a label to the Test indicating the Epic ID.

 

What I don't know how to do is look up that Epic ID associated with the Story that's associated with the Test.  Any ideas?

2 answers

1 accepted

0 votes
Answer accepted
Deleted user December 17, 2020

Helpful information but not quite what I was looking for.  Our Tests issue types are at the same level as a Story, meaning they aren't sub tasks.  Trying to determine how I can look up the Epic that is linked to the Story via the Epic Link field.  

Mykenna Cepek
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 17, 2020
{{issue.parent.Epic Link}}

Returns the issue key of the parent issue's epic.
0 votes
Mykenna Cepek
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 17, 2020

Assuming your "Test" issue type is at the Subtask level (not the Story level) in the Jira issue hierarchy, then the following might help you.

I created a test rule that can be manually invoked on any Subtask-level issue.

It will look up the parent Story, and then the parent Epic for that Story. The results are written to the log for that rule in Automation. Here's the output I got from my testing:

Rule triggered on Sub-task AAP-309 -- Parent Story is AAP-260 -- Epic is AAP-8

Screen Shot 2020-12-17 at 3.43.39 PM.png

I like using manually triggered rules to help figure things out. Tip: configure them for just one project (ideally a "playground" project) -- the default is that new rules are global to all projects.

Again, I'm assuming your "Test" issue type is a child of a Story (not a peer, and not a literally Linked issue). The wording in your original post is a bit ambiguous, particularly since "linked issues" in Jira have a meaning that is independent of the issue hierarchy.

Also, just know that Jira Automation does NOT treat an Epic as the "parent" of a Story:

  • use "issue.parent" to traverse from a Subtask-level issue to the related Story-level issue
  • use "issue.epic" to traverse from a Story-level issue to the related Epic.

This important detail is not real obvious from the documentation:

https://support.atlassian.com/jira-software-cloud/docs/smart-values-general/

Deleted user December 17, 2020

Helpful information but not quite what I was looking for.  Our Tests issue types are at the same level as a Story, meaning they aren't sub tasks.  Trying to determine how I can look up the Epic that is linked to the Story via the Epic Link field.  

Mykenna Cepek
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 17, 2020

{{issue.parent.Epic Link}} - Returns the issue key of the parent issue's epic.

Suggest an answer

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

Atlassian Community Events