views:

24

answers:

0

Actually I would like to have a query that finds all User Stories, whose all tasks and bugs are closed. The problem is that bugs are not connected directly to the user story but only to the test case, and the test case is connected to the user story. Another problem is that test cases link to user stories and are not children of them.

What I would like is a query like this (wrote what I want in Linq because I think it's clearer than clear text:-)

from story in tfs.CurrentProject.Stories
where story.State = "Active" &&
story.Tasks.Count > 0 &&
story.Tasks.All(task => task.State == "Closed") &&
(story.TestCases.Count == 0 ||
  story.TestCases.All(testcase => testcase.Bugs.Count == 0 || testcase.Bugs.All(bug => bug.State = "Closed")

Could someone help me with this or provide a different solution?

-Mathias