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 QueryTree 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 (Indent), outdent (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 QueryTree 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.

Note

You cannot modify the parent-child links that are locked (Link is 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).

Note

This topic illustrates how to work in Team Explorer, you can perform similar procedures in Team Web Access, although with slight variations.

Requirements

  • 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.

Query parts

  1. In the Query Editor, select Tree of Work Items for the Type of Query.

  2. Specify the filter criteria for the top tier of work items:

    1. 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.

    2. Choose or specify the values for Field, Operator, and Value. See Query Fields, Operators, Values, and Variables.

    3. 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.

  3. Specify the filter criteria for the child work items:

    1. Add, modify, insert, delete, and group clauses to filter the linked set of work items.

    2. To add a clause, choose Click here to add a new clause.

    3. Choose or specify the values for Field, Operator, and Value.

    4. Repeat steps 3a through 3c to add all of the filter criteria that return the work items that you want.

  4. Choose Match top-level work items first to find linked children, or choose Match linked work items first to find linked parents.

  5. (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.

  6. Choose Run Query (Team Explorer) 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.

  7. (Optional) Choose Column OptionsColumn Options to modify the set of columns that appears in the query results. See Add, Remove, Reorder, and Sort Columns.

  8. (Optional) Choose SaveSave Query. See Save, Copy, Rename, and Delete Work Item Queries.

  9. (Optional) Choose Collapse upper panelCollapse Top Panel to close the query editor.

Back to top

  1. In Team Explorer, open a tree view query.

  2. Modify the query to generate the list of work items that you want.

  3. 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 (Indent).

    • To remove a target work item from a source work item, click the source work item, and then click Outdent (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.

  4. Save or discard the changes:

    • To save the modifications, click SaveSave Results.

      Note

      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 queryRefresh. In the dialog box that opens, click No.

      Tip

      To discard changes to a work item, open the work item form, and then choose Refresh queryRefresh, and then choose No.

Back to top

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

See Also

Concepts

Choose Link Types to Effectively Track Your Project

Query Fields, Operators, Values, and Variables

Find Bugs, Tasks, and Other Work Items