1

As the title says, I have a "tree of work items" query that shows all parent work items ("Initiatives") that have a certain State (here: Closed) with their respective children which are not closed, so it looks something like that:

Parent 1 [Closed]
    Child 4 [New]
    Child 5 [Active]
Parent 2 [Closed]
Parent 3 [Closed]
    Child 2 [Ready]
    Child 4 [Active]

How can I filter out the parent work items that don't have any matching children? I.e. Parent 2 should not show up as a result of the query.

Gorgsenegger
  • 7,356
  • 4
  • 51
  • 89

1 Answers1

2

You can use Work items and direct links type of query instead of tree of work items

See below screenshot: User Stores that don't have any matching children will be filtered out.

enter image description here

Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43
  • Thanks, that helps :-) Is there also a way to only count the "top level" (i.e. parent) items returned by the query (e.g. for a tile on a Dashboard)? – Gorgsenegger Jul 14 '20 at 05:56
  • 1
    There is an extension tool [Query Tile PRO](https://marketplace.visualstudio.com/items?itemName=mskold.mskold-Query-Tile-PRO) (In the **filter** select **TopLevel**)which can achieve this. I am afraid it cannot be done through the query. – Levi Lu-MSFT Jul 14 '20 at 06:17