How to: Associate a Work Item with a Test

Using the Visual Studio Properties window, you can associate a work item with a test. A work item is a database record that Visual Studio Team Foundation Server uses to track the assignment and state of work. The most likely scenario for using this feature is that your lead assigns a work item to you in which you are to create a test. After you have created the test, you can associate the work item with the test you created. For more information about work items, see Working with Team Foundation Work Items.

Important noteImportant Note:

The work item database resides on a Team Foundation Server computer. This means that you can associate work items with tests only if you have Team Explorer installed, and if your Visual Studio user session is connected to a Team Foundation Server computer. For more information, see How to: Connect to Team Foundation Server.

To associate a work item with a test

  1. In the Team Explorer window, click a Team Project.

  2. In the Test List Editor or Test View window, select a test.

  3. Display the Properties for that test by pressing F4.

  4. In the Properties window, click Associated Work Items.

    An ellipsis (…) appears in the value column of the Properties window.

  5. Click the ellipsis.

    The Associated Work Items dialog box is displayed.

  6. Click Add.

    The Work Items Picker dialog box is displayed. Using this dialog box, you can query to see what work items are available. Running a query now would run a general query that could return a large result set. You can narrow the query's scope by specifying additional information, such as by typing one or more Work Item IDs or by typing text into the Title contains box.

  7. Click Find.

    The work items returned by the query are displayed.

  8. Select work items by selecting one or more check boxes in the left column.

  9. Click OK.

    The Work Items Picker dialog box closes and the Associated Work Items dialog box is displayed. It shows the numbers of the work items that you chose to associate with the test.

  10. (Optional) Verify that you selected the correct work items. To do this, view a work item's details by selecting a work item under Work items associated with the test and then clicking Details. When you have finished reading about the work item, click Close. You can remove inappropriate work items by selecting a work item under Work items associated with the test and then clicking Remove.

  11. When your list of work items is correct and complete, click OK.

    The work items you selected are associated with the test.

See Also

Tasks

How to: Create a Work Item from a Test Result

How to: Connect to Team Foundation Server

How to: Open Test Results from Work Items

Concepts

W (Visual Studio Team System Glossary)

Working with Team Foundation Work Items