I am trying to access the hierarchy level information for an issue in an Automation rule. The hierarchy level is an attribute of the issuetype structure:
"issuetype":{
"self":"https://something.atlassian.net/rest/api/2/issuetype/10004",
"id":"10004",
"description":"",
"iconUrl":"https://something.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10300?size=medium",
"name":"Feature",
"subtask":false,
"avatarId":10300,
"hierarchyLevel":2
},
I can reference many of the attributes using this syntax
{{issue.issuetype.name}}
...including id, description, name, and subtask.
But when I try {{issue.issuetype.heirarchyLevel}} or {{issue.issuetype.avatarId}} in a Log Action, nothing is printed in the rule execution audit log.
I checked for a change request for this but did not find one.
hierarchyLevel is a field available in JQL:
https://support.atlassian.com/jira-software-cloud/docs/jql-fields/#Hierarchy-level
I was trying this on a Premium subscription system at all issue type levels where the hierarchy is:
Feature > Epic > Story > Sub-task
Is anybody aware of a method to get an issue's hierarchy level in an Automation rule?
Community moderators have prevented the ability to post new answers.
First my disclaimers: I have not tried to use hierarchyLevel in rules before, and I'm trying this with the Free license version of Jira.
Using the REST API to check for supported smart values for rules, both avatarId and heirarchyLevel appear to be supported as you show for various issue levels: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
I confirmed your results that neither field is returned for triggered issues, lookups, or branches.
As I have been relying on that how-to article to know when / how fields are supported by rules, this seems like a defect to me. Perhaps submit this one to Atlassian Support to learn what they say.
As a work-around, please try calling the REST API issue search with the Send Web Request action from the rule. When I called this from a browser tab the fields were returned, and so they should be available in the web response message.
Kind regards,
Bill
Thank you for the confirmation, @Bill Sheboy .
I've opened a support case with Atlassian. I'll report back on what they say.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian's response confirms the attribute cannot be accessed directly via smart values:
I have not found this is available. In general, advanced roadmap concepts are not all mapped to automation for Jira. Here's an example ticket: https://jira.atlassian.com/browse/AUTO-994
I'm glad to add "hierarchy level" as another example to that ticket.
In the meantime, a work-around for what you're attempting to do may be possible by relying on JQL as hierarchyLevel is available here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the update, Trudy.
Did you let them know the REST API function the documentation suggests (for finding supported smart values) seems out of sync with that information?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did not.
I didn't interpret that document to be a guarantee that all fields are supported, but rather for fields that are supported that was the method to find the correct smart value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Old thread but
{{issue.issueType.hierarchyLevel}}
works for me :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This topic has been locked because the thread has become a bit dated. If you’d like to keep the conversation going or have additional questions, we encourage you to start a new topic. You can read more about necro posting (“raising threads from the dead”) in our Community Guidelines .
Thanks!
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.