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?
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.
{{issue.parent.Epic Link}}
Returns the issue key of the parent issue's epic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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:
This important detail is not real obvious from the documentation:
https://support.atlassian.com/jira-software-cloud/docs/smart-values-general/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{{issue.parent.Epic Link}}
- Returns the issue key of the parent issue's epic.
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.