Share via


Create or Delete Relationships Between Work Items

You can create relationships between work items to make a simple association, view two-tiered or hierarchical relationships, and track and manage dependencies. To create these relationships, you can add a link between one work item and another or many work items. When you add a link from one work item to another work item, Team Foundation must modify both work items.

All link relationships are stored in the work item database for Team Foundation. When you add, modify, or delete a link, your changes are applied to that database when you are working in Microsoft Excel or Microsoft Project. When you are working in Team Web Access or Team Explorer, your changes are applied to the database when you save one of the work items that are either the source or target of the link relationship.

When you create a one-to-many relationship, you use one of the following methods to create a list of work items:

  • Saved query. Use this method when you have created a query that you know contains the set or subset of the work items that you want. For more information, see Finding Bugs, Tasks, and Other Work Items.

  • Work item IDs. Use this method when you know the IDs of the work items and you would rather type those IDs than run a query or a title search.

  • Title search. Use this method to find work items that have a common word or phrase in the work item title field, and optionally, by team project and work item type.

In this topic

To add, modify, or delete a link in a work item, complete one of the following procedures:

Note

The following procedures assume that the team project uses the work item types for MSF for Agile Software Development, which are included with Team Foundation. If your team project uses a different process, these procedures might not apply to your work items. You might need to refer to the custom help documentation created for the process that you will use. For more information, see Access a Team Project Portal and Process Guidance.

Required Permissions

To add, modify, or remove a link between work items, you must have permission to view both of the work items and to modify at least one of them. You must be a member of the Contributors group or have your View work items in this node, and your Edit work items in this node permissions set to Allow. For more information, see Team Foundation Server Permissions.

  1. In Team Web Access, open the work item that you want to edit.

  2. Click the tab for managing links.

    Note

    The name of the tab might be Links, All links, or Implementation. The name of the tab is determined by the work item definition.

  3. Point to Add, and then click the type of link that you want to add.

    Note

    Do not select Changeset, Hyperlink, Test Result, or Versioned Item. These link types do not create relationships between work items. For more information about those types of links, see Creating Relationships Between Work Items and Other Resources.

    The Add Link/Attachment - Microsoft Team Web Access - Webpage Dialog box opens.

  4. Check the box which matches the method for finding work items that you want to use. For more information, see the procedure listed below: Finding, Listing, and Selecting Work Items to Add.

  5. Click Save or Save & Close.

  1. In Team Explorer, open the work item that you want to edit.

  2. Click the tab for managing links.

    Note

    The name of the tab might be Links, All links, or Implementation. The name of the tab is determined by the work item definition.

  3. Click Add.

    The Add Link Dialog box opens.

  4. Specify the work items to which this work item should link.

    Note

    Do not select Changeset, Hyperlink, Test Result, or Versioned Item. These link types do not create relationships between work items. For more information about those types of links, see Creating Relationships Between Work Items and Other Resources.

    For more information, see the procedure listed below: Finding, Listing, and Selecting Work Items to Add.

  5. (Optional) Type a description in the Comment box.

  6. Click OK.

  7. Click Save Work Item.

  1. In the Microsoft Excel worksheet or Microsoft Project plan, click the work item to which you want to add a link.

  2. On the Team menu, click Links and Attachments.

  3. Click the Links tab.

  4. Click Add.

  5. In the Link type list, click the link type that represents the relationship that you want to create.

  6. Specify the work items that should link to this one.

    Separate multiple IDs with commas.

    For more information, see the procedure listed below: Finding, Listing, and Selecting Work Items to Add.

  7. Click OK.

  8. In the View/Edit Work Item Links and Attachments dialog box, click Publish, and then click Close.

  9. (Optional) Save the Office Excel worksheet.

  10. (Optional) On the Team menu, click Refresh.

    This step causes modifications made to parent-child links to appear in the Office Excel worksheet. 

Finding, Listing, and Selecting Work Items to Add

To find, list, and select work items

  1. (Optional for Team Explorer) If you create a link to a work item that is in defined in another team project, in the Project list, click the name of the project that contains the work items that you want to find.

    Note

    The Project list appears only when you are searching for work items to link to the current work item.

  2. Specify one of the following search methods, and then define the search criteria:

    • Saved query

      In the Saved query list, expand the team project (Team Web Access only), expand My Queries or Team Queries, and then click the name of the saved query for which you want to display results.

      (Team Explorer only) You can also click the Browse button next to the Saved query list, select a saved query in the Select Query dialog box, and then click OK.

      Note

      The Select Query dialog box is often the best solution if your team project contains many queries. You can drag a corner of the dialog box to make it larger and display more saved queries.

    • IDs

      In the IDs box, type the work item IDs of the work items that you want to find. Separate IDs by commas or spaces.

    • Title contains

      In Title contains, type the word or words that the work item title should contain.

      (Optional for Team Explorer) In the and type list, click the type of work item that you want to retrieve. 

      (Optional for Team Web Access) In the Work item type list, click the team project and type of work item that you want to retrieve.

      Note

      If you narrow the filter criteria for the search, the query runs more quickly.

  3. Click Find.

  4. (Optional) Change the display of the result list by performing any one of the following steps:

    • To expand or collapse a tree view list, click the (+) or (-) signs.

    • To resize a column, point to the edge of a column title and drag the column boundary to a new location.

    • To sort on a column field, click the column title.

    • To move a column field, click the column title and drag it to another location.

    For additional options, see Keyboard Shortcuts for the Query Editor and Query Results View.

  5. Specify each item in the result list that should link to the current work item.

    • Team Web Access: select or clear the check box next to each work item, or click Select All to select all the work items. 

    • Team Explorer: select each work item to specify that it should link to the current work item. To specify a continuous range of work items, press and hold the SHIFT key when you click the first and last work item in the range. To specify a non-continuous set of columns, press and hold the CTRL key when you click each work item.

  6. (Optional for Team Web Access) Type a description in the Comment box.

  7. Click OK.

  1. Perform one of the following actions;

    • In Team Web Access or Team Explorer, open a work item on one side of the link, and click the Links tab on the work item form.

      Note

      The name of the tab might be Links, Other links, or Implementation. The name of the tab is determined by the work item definition.

    • In Microsoft Excel or Microsoft Project, click the work item from which you want to modify a link, and then on the Team tab or menu, click Links and Attachments.

  2. Click the link that you want to modify, and then click Edit.

  3. Modify the link attributes, and then click OK.

  4. Review the link in the Links tab, and then press Ctrl+S to save the work item and the changes made to the link.

  1. Open the source work item that contains links that you want to delete.

  2. Click the tab for managing links.

    Note

    The name of the tab might be Links, Other links, or Implementation. The name of the tab is determined by the work item definition.

  3. Click or select the work items that should no longer be linked to the source work item.

    To specify a continuous range of work items, press and hold the SHIFT key when you click the first and last work item in the range. To specify a non-continuous set of columns, press and hold the CTRL key when you click each work item.

  4. Click Delete Link.

  5. Click Yes to confirm the deletion.

  6. Click Save to save the changes to both the source and target work items, and to delete the links from the Team Foundation database. 

  1. In the Microsoft Excel worksheet or Microsoft Project plan, click the work item from which you want to delete a link.

    Note

    If you are working offline in Microsoft Excel or Microsoft Project (that is, you are not connected to Team Foundation Server), you cannot create or delete links to work items using the procedures provided in this topic. To create a link to a work item, it must be defined in the Team Foundation database. Exceptions to the online storage constraint are parent-child links in Microsoft Excel and both parent-child and predecessor-successor links in Microsoft Project. The exceptions apply to new work items that you have not yet published and also to work items that are already in the database.

  2. On the Team tab or menu, click Links and Attachments.

  3. In the View/Edit Work Item Links and Attachments dialog box, click the Links tab.

  4. Click or select the work items that you no longer want to be linked to the source work item.

  5. Click Delete Link.

  6. Click Yes to confirm the deletion.

  7. Click Publish to save the changes to the Team Foundation database.

  8. (Optional) Save the Microsoft Excel worksheet or Microsoft Project document.

  9. (Optional) On the Team menu, click Refresh.

    This step causes any changes that were made to links to appear in the Microsoft Excel worksheet or Microsoft Project document.

See Also

Tasks

Create, Open, and Modify Work Items Using Office Excel

Sequence or Subordinate Tasks in Office Project

Create a Microsoft Project Plan from Team Foundation Work Items

Concepts

Linking Work Items (Agile)

Linking Work Items (CMMI)

Finding Bugs, Tasks, and Other Work Items

Other Resources

Creating Relationships Between Work Items and Other Resources