Jira JQL - Show all child tasks

◇◆丶佛笑我妖孽 提交于 2019-12-08 11:09:16

问题


Hello I need some help using JQL

I am trying to display all my tasks under 3 levels of Macro-Feature and/or Epic Link, as my organization look like this :

- Macro Feature

  • Epic Link (= feature) => Epic Link (= subfeature) => Tasks
  • or directly Epic Link => Tasks

I want to see both levels, how can I achieve this please ?


回答1:


In pure Jira Server, it is not possible to follow the links, you will have to query issues assigned to the epic, take their issue keys or ids and build a combined query. Let's say you have top-level epics called TOP-1 and TOP-2, you will have to run a query:

issue in linkedIssues("TOP-1", "is task of") and issuetype = Epic

take the returned issue keys, repeat for TOP-2, this will give you the second level epics, let's say SUB-1 and SUB-2, then you need to run a query like:

"Epic Link" in (TOP-1, TOP-2) or "Epic Link" in (SUB-1, SUB-2)

this will give you issues assigned to those epics, without subtasks. Quite cumbersome and requires manual updating, definitely not worth doing.

The alternative would be getting a plugin that extends JQL functionality, like JQL Search Extensions. Then you could nest the JQL queries like:

issue in allIssuesInEpic("TOP-1", "TOP2") or (issue in allIssuesInEpic(issue in linkedBy("TOP-1", "TOP-2", "is task of")))

Where first part of the query issue in allIssuesInEpic("TOP-1", "TOP2") returns the issues directly assigned to the TOP-1 or TOP-2 epics, and the second part issue in allIssuesInEpic(issue in linkedBy("TOP-1", "TOP-2", "is task of")) finds the epics linked as "is task of" with top-level epics and then finds all the issues with subtasks assigned to those second level epics. You will need to extend the query for every level of nesting, with the structure you have described, above query will do what you need. However, if you will add the third level of nesting then you will have to extend the query like:

issue in allIssuesInEpic("TOP-1", "TOP2") or (issue in allIssuesInEpic(issue in linkedBy("key in (TOP-1, TOP2) or issue in linkedBy("TOP-1", "TOP-2", "is task of")", "is task of")))

You can make it more readable by creating filters for each level of nesting, for example, create a filter called Features:

key in (TOP-1, TOP-2)

then create a filter called sub-features:

issue in linkedBy("filter = Features", "is task of")

then create a final query like:

issue in allIssuesInEpic("filter = \"Features\" or filter = \"sub-features\"")


来源:https://stackoverflow.com/questions/52034590/jira-jql-show-all-child-tasks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!