In TFS (MSF Agile), How do I query for Active User Stories with all child tasks closed?
Asked Answered
U

1

12

I'm currently writing a series of "Sanity Check" queries for our MSF Agile based project on TFS 2010.
The search I'm struggling with is the following:
Find all User Stories which:
- Have child tasks (or bugs)
- All child tasks/bugs are in the Closed state
- The parent User Story is not closed

The goal being to find user stories that should/could be closed but are not yet.

There doesn't seem to be a way to get the count of child tasks, if I could do that then I could search for "has child tasks, and no child task is not closed". But perhaps there is another way to get the end result I am after ?

Update: More information
My closest search to this so far is:
Team Project = @Project
And Work Item Type = User Story
And State <> Closed
and linked items that match the query below
State <> Closed
Linking Filter: Only return items that do not have the specified links

This almost gets me what I want, however it returns user stories which have no tasks attached, I do not want those to be included.

Untold answered 14/11, 2011 at 0:14 Comment(0)
A
14

First you need to change the type of query to be "work items and Direct Links"

In the first query type the following:

Field ------> Work Item Type

Operator---> =

Value -----> User Story

In the second criteria table which is the child of work items, choose all criteria you need

Edited

See the following image

enter image description here

Actuality answered 14/11, 2011 at 8:56 Comment(4)
Sorry, I already understand that part of the problem. The issue is that I cannot work out what the criteria should be in order to say "this user story has child tasks, and all it's child tasks are in the closed state" (or, it has child tasks and none are in a not closed state, which is easier to do) - it's the "has child tasks" that I cannot figure outUntold
I add image that explain how to do thatActuality
Perhaps I'm not explaining this properly. Your query will find all user stories that are active and have closed tasks/bugs. It also returns user stories that are active and have both active and closed tasks (but does not show the active tasks in the report). I need to find only those user stories that have no Active tasks/Bugs, but do contain at least one task/bug which is closed.Untold
No you explain very well but I just thought you may just need a start point but when I dig in I found it really tricky, I think we need to create sub query but as I know this not supported by WIQL so you will need to create a custom query by code see this link for help ewaldhofman.nl/post/2010/04/20/…Actuality

© 2022 - 2024 — McMap. All rights reserved.