Working with Linked Hierarchies (Tree of Work Items)
You can view a nested set of work items that have been linked through parent-child or topology links by selecting the Tree of Work Items query type. Within the tree view, you can focus on different parts of the tree by expanding or collapsing leaf nodes. In addition, by using Team Explorer, you can indent (), outdent (), and use drag and drop to both move and copy work items and modify the hierarchy. You can also quickly create or remove tree links.
Choose the Tree of Work Items query type to perform the following tasks:
View the hierarchy.
Find parent or child work items.
Change the tree hierarchy.
Export the tree view to Microsoft Excel for either bulk updates to column fields or to change the tree hierarchy.
You cannot modify the parent-child links that are locked (). These links are controlled by another process, such as Project Server. For more information, see Review the Work Breakdown.
You can use the tree view only to list work items that are related using tree topology links. To view two-tiered relationships among work items that are related based on any type of link, choose the Work Items and Direct Links query as described in Working with Linked Dependencies (Direct Links).
This topic illustrates how to work in Team Explorer, you can perform similar procedures in Team Web Access, although with slight variations.
- To create, save, or modify a query, you must be a member of the Contributors group or have the Edit work items in this node permission set to Allow. For more information about query permissions, see Find Bugs, Tasks, and Other Work Items.
Listing work items in a tree view
The following example shows the Sprint Backlog tree query, which is a predefined query provided with the Visual Studio Scrum process template. This query returns all top-level tasks, bugs, and product backlog items for the team project that are currently assigned to Sprint 1 and not in a Removed state. In addition, it returns those tasks that are linked to the top-level items.
In the Query Editor, select Tree of Work Items for the Type of Query.
Specify the filter criteria for the top tier of work items:
Add, modify, insert, delete, and group clauses to filter the set of work items you want. Each clause includes an AND/OR operator, a field, an additional operator, and a value.
To add a clause, choose Click here to add a new clause. If you want it to be treated as an Or clause, choose And, and then choose Or. For details about grouping clauses, see Add, remove, group, or ungroup query clauses.
Choose or specify the values for Field, Operator, and Value. See Query Fields, Operators, Values, and Variables.
Repeat steps 2a through 2c to add all of the filter criteria that return the list of work items that you want. Group or ungroup clauses as needed. See Specify Query Filter Criteria.
Specify the filter criteria for the child work items:
Add, modify, insert, delete, and group clauses to filter the linked set of work items.
To add a clause, choose Click here to add a new clause.
Choose or specify the values for Field, Operator, and Value.
Repeat steps 3a through 3c to add all of the filter criteria that return the work items that you want.
Choose Match top-level work items first to find linked children, or choose Match linked work items first to find linked parents.
(Optional) If you have added custom hierarchical link types, you can change the value of the Link Type to one that matches your custom link type. See Link Type Element Reference.
Choose Run. Modify your filter criteria until you get the results that you want.
The top tier of work items appears as a tree hierarchy that contains all work items that are related with parent-child links.
(Optional) Choose Column Options to modify the set of columns that appears in the query results. See Add, Remove, Reorder, and Sort Columns.
(Optional) Choose Save Query. See Save, Copy, Rename, and Delete Work Item Queries.
(Optional) Choose Collapse Top Panel to close the query editor.
Back to top
Modify link relationships
In Team Explorer, open a tree view query.
Modify the query to generate the list of work items that you want.
Change the link relationships of work items by taking one of the following steps:
To move a work item, click a source work item and drag it to a new target work item.
If a source work item is already directly under its target, click the work item, and then click (Indent).
To remove a target work item from a source work item, click the source work item, and then click (Outdent).
To add a link relationship, click a source work item, press the CTRL or Shift key, and drag it to a new target work item.
To delete a linked relationship, open the target work item, click the Links tab, and delete the source work item. For more information, see Create or Delete Relationships Between Work Items.
Work items with links that have changed are highlighted in bold, which indicate that they have been modified.
Save or discard the changes:
To save the modifications, click Save Results.
If one or more work items do not save, then open each parent work item individually and click Save Work Item.
To discard the changes, click Refresh. In the dialog box that opens, click No.
To discard changes to a work item, open the work item form, and then choose Refresh, and then choose No.
Back to top
Modify links using Microsoft Excel or Microsoft Project
You can export your query to Microsoft Excel or Microsoft Project and update work items and link relationships between work items. When you do this, only those work items that are defined for the team project for which the query itself is defined are imported into the Microsoft Office client.
To open the query from Team Explorer
Open the query and then choose Open in Microsoft Office, Open in Microsoft Excel.
Or, open the shortcut menu for the query and then choose Open in Microsoft Excel.