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.
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
In the Team Explorer window, click a Team Project.
In the Test List Editor or Test View window, select a test.
Display the Properties for that test by pressing F4.
In the Properties window, click Associated Work Items.
An ellipsis (…) appears in the value column of the Properties window.
Click the ellipsis.
The Associated Work Items dialog box is displayed.
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.
The work items returned by the query are displayed.
Select work items by selecting one or more check boxes in the left column.
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.
(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.
When your list of work items is correct and complete, click OK.
The work items you selected are associated with the test.