Forums

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

Automation - smart value for hierarchy level of issue?

Trudy Claspill
Community Champion
January 8, 2024

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?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
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.
January 8, 2024

Hi @Trudy Claspill 

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

Trudy Claspill
Community Champion
January 8, 2024

Thank you for the confirmation, @Bill Sheboy .

I've opened a support case with Atlassian. I'll report back on what they say.

Like Bill Sheboy likes this
Trudy Claspill
Community Champion
January 9, 2024

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.

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.
January 9, 2024

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?

Trudy Claspill
Community Champion
January 9, 2024

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.

0 votes
Aleksi Leinonen April 30, 2025

Old thread but

{{issue.issueType.hierarchyLevel}}

works for me :) 

SilkeS
Community Manager
Community Managers are Atlassian Team members who specifically run and moderate Atlassian communities. Feel free to say hello!
April 30, 2025

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!

DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events