The good news is there is now a new attribute, parentId that is unifying the concept “hierarchy” in Jira. Aside from deprecation, you can learn more about the APIs for hierarchy in this developer announcement:
Thanks for the response!
I think, it will not be a problem for us, as we don’t care about the hierarchy level.
The question rather:
How to get nested items for any issue?
Maybe there is a hidden api method “GET /NestedElements” which returns everything for epic, task or a custom level created for roadmap?
There isn’t any good way to solve the problem. What is more you need to resolve ( find out) what is the clause for parentLink in meta, because it may be translated, so you need to fetch rest/api/2/field first. Then you also need to know if you are in a next-gen project (team-managed project) so you need to fetch project, then a last you can call jql for child issues, then a jql for subtasks, etc…
Thx! This is what we do right now and it’s really shitty logic.
Btw, regarding the translations, some methods support accept lanugage Accept-Language - HTTP | MDN
Don’t have this option, only the parent, parentLink, and parentEpic . Is it a new attribute?
In general, it works, but the condition is really complex.
I write the following JQL query to get the children of an issue in a unified way where it doesn’t matter what the parent-child relationship is:
parent=SOME-KEY OR "Epic Link"=SOME-KEY OR "Parent Link"=SOME-KEY
parent covers Task-Subtask and Epic-Task relationship in Team Managed Projects (TMP) and Task-Subtask relationship in Company Managed Projects (CMP)
Epic Link covers Epic-Task relationship in CMP
Parent Link covers Feature-Epic and above with Advanced Roadmaps
To get all the childrens’ children in one query I use webhooks to save the parent keys of each issue in an entity property called allParentIssues. That way I can search allParentIssues = SOME-KEY and get all the children and childrens’ children, and children’s childrens’ children ect in one query.