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 Find 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 enter 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.

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 or Process Guidance.

Note

To create a work item and link to an existing work item, see Create a Linked Work Item.

To add, modify, or delete parent-child links, see Work with linked hierarchies (Tree of Work Items) or Bulk add or modify work items with Excel. To work with the native tools of Microsoft Project to create and manage parent-child and predecessor-successor links, see Create your schedule, backlog, and tasks using Microsoft Project.

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 Add team members to a team project or a team.

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

  2. Choose a links control tab that matches the type of work item, type of link relationship, or object that you want to link to.

    Note

    The name of the tab might be Links, All links,Implementation, Storyboards, Tasks, Test Cases, or other label. The names of the available tabs are determined by the type of work item and its definition.

  3. Choose Add LinksAdd.

    The Add Link to work item dialog box appears.

  4. Choose the link type that you want to add.

    Based on the link controls specified for the link tab, you may be restricted to a single link type or be able to select from a selection of link types.

    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 Link work items and objects to support traceability.

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

  5. Based on the type of link that you selected, do one of the following:

    • Enter the IDof the work item that you want to link to.

      To link to several items, enter a comma-delimited set of IDs or choose the Browse button when available. For more information, see Find, list, and select work items to add.

    • Enter the location of the storyboard that you want to link to.

      Note

      Before you can link a storyboard to a work item, you must save it to a shared location. The shared location can be any shared folder on the network, a SharePoint site, or a team project portal. By linking the storyboard to a work item, you provide your team access to the shared file where they can add their comments.

  6. Choose OK, and then choose Save, Save and Close, or Save work item.

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

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

  3. Choose the Links tab.

  4. Choose Add.

  5. In the Link type list, choose 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: Find, list, and select work items to add.

  7. Choose OK.

  8. In the View/Edit Work Item Links and Attachments dialog box, click Publish, and then choose 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. 

Find, list, and select 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, choose 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 choose 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, choose the type of work item that you want to retrieve. 

      (Optional for Team Web Access) In the Work item type list, choose 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. Choose 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, choose 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, choose the column title.

    • To move a column field, choose 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 choose 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 choose each work item.

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

  7. Choose 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 choose the links control tab that contains the link you want to modify.

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

  2. Choose the link that you want to modify, and then choose Edit.

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

  4. Review the link in the links control 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. Choose a links control tab that contains the link that you want to delete.

  3. Choose 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. Choose Delete linkDelete Link.

  5. Choose Yes to confirm the deletion.

  6. Choose 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, choose 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, choose Links and Attachments.

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

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

  5. Choose Delete Link.

  6. Choose Yes to confirm the deletion.

  7. Choose 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, choose Refresh.

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

See Also

Concepts

Link Controls, Restrictions, and Field Reference

Bulk add or modify work items with Excel

Create your schedule, backlog, and tasks using Microsoft Project

Other Resources

Link work items and objects to support traceability