title: In TFS (MSF Agile), How do I query for Active User Stories with all child tasks closed?
body: <p>I'm currently writing a series of "Sanity Check" queries for our MSF Agile based project on TFS 2010.<br/>
  The search I'm struggling with is the following:<br/>
  Find all User Stories which:<br/>
  - Have child tasks (or bugs)<br/>
  - All child tasks/bugs are in the Closed state<br/>
  - The parent User Story is not closed<br/>
  <br/>The goal being to find user stories that should/could be closed but are not yet.<br/><br/>
  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 ?</p>
  
  <p><em>Update: More information</em><br/>
  My closest search to this so far is:<br/>
  Team Project = @Project<br/>
  And Work Item Type = User Story<br/>
  And State &lt;> Closed<br/>
  <em>and linked items that match the query below</em><br/>
  State &lt;> Closed<br/>
  Linking Filter: Only return items that do not have the specified links<br/>
  <br/>
  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.<br/></p>