Monthly Archives: October 2010

Creating “Tree of Work Items” queries with VS2010

This week i found some handy feature, when i was trying to create a nice overview of workpackages and underlying tasks in TFS. It’s called “Tree of Work Items” and it gives the ability to do perform a query on workitems in TFS, and on the result of that query we can perform another query on all linked items of the above result.

For example you have some (general) tasks called: “Workpackage X – Develop feature Y” (where X and Y can be any number), and we have linked to that item all the subtask that are needed to develop feature Y. We can query for all general tasks that start with Workpackage, and query all below tasks that are not closed or resolved.

To create this query we have to take the following steps:

1. Click on “New Query” in Team Explorer


2. Select in the dropdownlist the type of query: “Tree of Work Items”

3. Fill in the parameters for both queries


4. Run the query.

The result will look like the below picture.

You will see that you can expand/collapse the top task.

Within the toolbar on top of the result you will see the expand / collapse all buttons which are pretty handy to quickly collapse or expand the whole list.


Also exporting the result to Excel gives you the ability to filter data easily and only show the top task or all tasks.

For me this is a very handy new feature of VS2010 to create a quick list of nested workitems.