28

how can I define a query in TFS 2013 (Team Explorer 2013) to get all items as a list below a certain toplevel workitem:

|--+-Parent 1
   |
   |--+-Child 1
   |  |--Child of Child 1
   |
   |--+-Child 2
   |  |
   |  |--Child of Child 2
   |
   | ...

Result:

  • Child 1
  • Child of Child 1
  • Child 2
  • Child of Child 2

Is this possible?

Thanks, Konrad

ruffin
  • 16,507
  • 9
  • 88
  • 138
Konrad
  • 4,329
  • 10
  • 54
  • 88

4 Answers4

34

Step 1 - Select "Tree of work items"

Step 2 - Set up the query as usual for the top level work items, for example only "Epic" work items with id 4247 (whatever you like really).

Step 3 - Under "Filters for linked work items" you can exclude descendent items, for example you could show only PBIs, or only bugs etc.

Example Query

Fenton
  • 241,084
  • 71
  • 387
  • 401
2

Yes, use a "Tree of Work Items" type of query.

Giulio Vian
  • 8,248
  • 2
  • 33
  • 41
  • If I use the tree, I couldn't filter out some childs I don't want (e.g. of a certain type like "Feature") ... I need it in a pure list, to get the total count of items. – Konrad May 22 '14 at 07:27
  • @Konrad Can't you limit type with that `Work Item Type` that's displayed in the answer from @Fenton? – ruffin Aug 18 '19 at 17:20
2

Konrad,

The most simple way to learn how build this querys is: on backlog turn on features, user story and task, I know you want features, then click create a query, give a name. That query show you how to build one with tree and WIT's with same type like sub-query, for example.

After you do this, tell us what you want to refine.

egomesbrandao
  • 788
  • 6
  • 16
  • I created about 100s of queries with tfs the last years. so let me clearify this: I've a topmost item (feature) and under this many tasks and bugs and other features with task and bugs under and so on. ... If I use the tree view query, i get a well formed tree with all 3 WIT in a structure. But I only need the tasks and the bugs ... so I want to "filter out" all feature WITs but without loosing the tasks and bugs on the 2nd, 3rd, ... level under the topmost feature. Why? Because I want the correct number of tasks/bugs as the count without the structuring feature work items. – Konrad May 28 '14 at 14:44
  • 1
    You need the tasks and bugs items that are children of a feature is on the second level, or children of a feature, but do not want to appear a feature, is it? – egomesbrandao May 28 '14 at 14:54
  • Yes, that's right. All tasks and bugs on all levels below the top feature - but not the features itself on the way down the tree. – Konrad Jun 03 '14 at 07:12
1

Sad story is that you can't make charts for this type of query, for exapmle to see % of bugs/tasks completed

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/33472485) – Parisa.H.R Dec 26 '22 at 09:24