Find, Link, and View Source Code Files Associated with a Work Item
You can link version control files to work items when your team uses Team Foundation version control. You can associate version control changes to a particular work item. This strategy allows other members of your team to determine what changes have been made in the source code to address a work item.
You can perform the procedures in this topic from either Team Explorer or Team Web Access.
In this topic
Viewing Source Code Files That Are Linked to a Work Item
Linking a Work Item to a Source Code File
Finding Source Code Files to Link to a Work Item
Required Permissions
To perform these procedures, you must be a member of the Contributors group or your View work items in this node, Edit work items in this node, Read, Check In, and Check Out permissions must be set to Allow. For more information, see Team Foundation Server Permissions.
Viewing Source Code Files that are Linked to a Work Item
To view the source code file that is linked to a work item
Open a work item, and then click the Links or All Links tab.
Source code files are listed under the Versioned Item group.
Right-click the versioned item that you want to view, and then click Open Linked Item.
How the item opens depends on the type of file that you have selected.
Linking a Work Item to a Source Code File
To link a work item to a source code file
Check in the source file to Team Foundation version control.
Open the work item that you want to link to the source code, and then click the Links or All Links tab.
Click Link to.
In the Add Link dialog box, in the Link type list, click Versioned Item.
In the Item box, type the path and file name of the source file, or browse to the source file by clicking Browse.
In the Link to list, click Latest Version to link to the most recent version of the file at all times.
(Optional) In the Comment box, enter a comment that describes why you are linking the work item to this source code file.
Click OK.
On the work item toolbar, click Save Work Item.
Finding Source Code Files to Link to a Work Item
To find a source code file to link to a work item
Check in the source code file to Team Foundation version control, and open the work item that relates to the file.
Complete the required fields at the top of the form.
For example, you might be resolving the work item at the same time.
Click the Links or All Links tab, and then click Link to.
In the Add Link dialog box, in the Link Type list, click Versioned Item.
Under Link Details, click Browse.
In the Browse dialog box, locate the source file to which you want to link, and then click OK.
Under Link to, specify the version of the file.
Latest Version Links the work item to the most current version of the source code file.
Changeset Lets you specify a number for a changeset that links the work item to the specific version of the source code file that the changeset contains.
(Optional) Under Comment, type information that is important about this particular link.
Click OK.
On the work item toolbar, click Save Work Item.
See Also
Tasks
Find, Link, and View Changesets Associated with a Work Item
Concepts
Develop Code and Manage Pending Changes