TFS 2010 Query - Releated work items AND all of their children (in a tree) RRS feed

  • Question

  • We're running TFS 2010 at my company and have created our own Work Item type, called Release.  In this Work Item type, we have several Linked Requirement Work Item types that are of type "Related".

    Each of these Requirements has a typical structure of containing child Task Work Item Types.

    Does anyone know how to create a Tree Query so that it can return all the Related Requirements, and for each of those Requirements, all of the Children?  For example, running a search on the "Release" WIT will return all the Requirements that have a collapsable tree showing the Child Tasks?


                                  --[Child Task]

                                  --[Child Task]


                                  --[Child Task]


    I understand how to create a Work Items and Direct Link query, but when Querying the "Release" WIT, it will only show the Related Requirements.  I'm trying to find a way to get those Requirements to be expandable.




    Thursday, January 13, 2011 10:13 PM

All replies

  • The query cannot display multiple relationships like that.  You can certainly get it to return all of the records, but you'd see the release/ requirement pairs as well as the Requirement/Child pairs as well (meaning you'd have duplications in the Requirements on the query, one as a child and the other as a parent.)

    Interestingly, the integration to MS project does display the parent/child/child n.. relationship as a hierarchy when it builds these as rollup tasks.  If you are just looking for a way to display them this way, I'd look to either project or a custom SSRS report.  Remember that project can only see two link types, one as the rollup and one as dependencies.  You would need to use the same link type between release and requirement as you would for requirement and child task.

    The instructions for putting custom link types in the project integration are incorrect on MSDN.  I have posted the correct syntax here: http://ryanhanisco.com/tfs-custom-links-in-ms-project-2010/

    Hope this at least helps a bit.

    Ryan Hanisco MCSE, MCTS:SQL 2005, Project+ http://techsterity.wordpress.com
    • Edited by Ryan Hanisco Wednesday, October 17, 2012 11:05 AM Replaced the link with a working one.
    Thursday, January 13, 2011 11:17 PM
  • Hi Felix,

    Thanks for posting the issue here!

    Do you mean you want to display the child work items?

    Please perform the following steps:

    1. create a new query,

    2. In the Type of Query, select Work Items and Direct Links,

    3. specify the filter criteria for the top tier of work items,

    4. In the And linked work items that match the query,

    5. In the Linking Filters, select Only return items that have the specified links under Top level work items,

    6. In the Types of links, select Child under Return selected link types

    Hope it helps!

    Best Regards,

    Cathy Kong [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, January 14, 2011 8:18 AM
  • Hi Kathy,

    This works great to show the work items on the other end of the links.  I think Felix is looking for a way to show the children of children (multiple linkages rather than just one.)

    Have you seen a way to get the query to show that in a tree view?

    Ryan Hanisco MCSE, MCTS:SQL 2005, Project+ http://techsterity.wordpress.com
    Friday, January 14, 2011 3:51 PM
  • Hi Felix and ryan,

    I am currently looking into this issue and will give you an update as soon as possible.
    Thank you for your understanding and support.

    Best Regards,

    Cathy Kong [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, January 19, 2011 9:23 AM
  • Ryan and Cathy,

    Thanks for the suggestions!  Sorry for the late reply..I guess my Alerts for this thread is having issues and didn't realize you all replied.  Strange...

    Anyhow, the query I'm trying to achieve is to get a results set of the following:

    1.  Top level results set:  Get All "Related" linked Work Item Types to our custom "Release" work item type.

    2.  Withing that results set of "Related" types, get all of the their children.

    Basically, it's a Work Item with Direct Links, and for the Direct Links results, it's all the children.  I know this can be achieved with two separate queries, but I was hoping that it can be done in one. 

    If I can't do it like that through TFS queries, is it something that's possible with Excel?  I'm a bit new to the query/reporting features to TFS so I'm still learning a lot.




    Wednesday, January 26, 2011 7:53 PM
  • Hi Felix,

    As I think you've seen, getting at the singular Parent/ Child relationship is pretty easy through the query editor and that singular kind of relationship is all the query can return.

    Parent 1
      -- Sub Child

    gets interpreted as below, looking at the relationships as being unique:

    Parent 1
    -- Child

    -- Sub Child

    As you can see, this is not ideal, though the data are all there and can be interpreted.  The only think I know of that is able to give you the full, multi-tiered relationship that you want to see is MS Project.  It is able to stitch that together in a hierarchical view.  (It'll also be able to look to another relationship type to determine precedence dependency, but that is a separate topic.)

    Ryan Hanisco MCSE, MCTS:SQL 2005, Project+
    Wednesday, January 26, 2011 9:45 PM
  • is there any update on this?

    I am also looking on how i can generate a query that  will look something like this:


     - childA

         - related links to child, not only as a"child" relationship of  childA but also those that are affectedBy childA,Test case of childA, Related to childA, etc...

    the main goal is to be able to easily identify what are all the linked items (be it use case, test case, deliverable, task, etc) in a specific/all requirements.

    I was thinking that an answer to the original question in this trail could help me with my goal.

    Wednesday, September 14, 2011 6:54 AM
  • Either the list or the hierarchy views are only able to be aware of one link type at a time.  Especially with the nesting of use cases, this would not be possible.   (If you were to disallow nesting like that, you might be able to get the view you want through categories by making a custom one for all lower-linked items and then filtering on the category -- but that is a spoof and there are likely to be undesirable edge cases.)

    Your best bet would be to create something custom in SSRS/Excel OR narrow down the number of link types you are using.

    Incidentally, the link to project will allow two -- one for the linkage (parent/child by default) and one for order (predecessor).  This can give you a good view into the whole work stream through MS Project.


    Hope this helps.

    Ryan Hanisco, PMP
    MCSE, MCTS:TFS 2010, SQL 2005
    Wednesday, September 14, 2011 2:15 PM
  • the answer is TFS don't have that capability
    Thursday, February 2, 2012 5:50 PM
  • Why don't you simply define the release work item as parent of the Requirements? It will comply with your need. Is there a reason for not doing that?
    Thursday, May 3, 2012 10:26 AM
  • Thanks for the suggestion Sebastian, but yes, the reason that won't work is because Work Items can only have one parent.  In this case, sometimes the Requirements are already tied as children of a bigger project.
    Thursday, May 3, 2012 10:57 PM