Anyone know how to write a query in TFS that will show any Features whose State is not 'DONE' but whose child User Stories or similar are 'DONE'?
Asked
Active
Viewed 919 times
2 Answers
0
There is no default way to get Features not 'Done' but all child User Stories are 'Done' from a Query. You would achieve your requirement by using REST API to get parent/child work items from Wiql, and then check state
for all child work items:
- https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/wiql?view=azure-devops-rest-5.1
- https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items?view=azure-devops-rest-5.1
Or you can create a Tree of work items
to return all Parent not 'Done', and then export the query to CSV to filter the Child manually:

Cece Dong - MSFT
- 29,631
- 1
- 24
- 39
0
Of course this can be done. It's similar to what I've done here.
Basically search for
Query Type: Work Items and Direct Links
Top level:
Work Item Type: Feature
State: <> Done
Child level:
Work Item Type: in(Bug, User Story)
State: <> Done
x Only show work items that don't have the specified link
Link types [Parent Child]

jessehouwing
- 106,458
- 22
- 256
- 341
-
Your example will filter User Stories that contain one or more closed child's. But if you want to find User Stories only with all closed child's , there is no way to filter out them. – Shamrai Aleksander Mar 12 '20 at 11:28
-
@ShamraiAleksander No it filters Features that have no childern in another state than done. The "Only show items that don't have the specified link" does that. – jessehouwing Mar 12 '20 at 12:02
-
yes, you are right, that will work. However, your example`ll also return Features without any child work item because they also do not have (Bug, User Story) & State: <> Done )) – Shamrai Aleksander Mar 12 '20 at 12:39