Add work item links from check in comments

The other night while watching the Visual Studio 2013 Launch a question came up asking if the team had added support yet for automatically linking work items to the change set created when checking in as it currently is in Git. Currently this functionality doesn't exist for TFVC Check ins, at the time I didn't think anything of it but tonight for some reason I thought "hey that would be something simply to create and should hopefully make lives easier for developers". So I opened up Visual Studio and at the same time started a new project on GitHub for TFS Server Plugins. The code required for the plugin was very basic, basically just checked the comment from the check in with a regular expression and then added the links between the change set and all the IDs found in the comments.
📅 16 Nov 2013

The other night while watching the Visual Studio 2013 Launch a question came up asking if the team had added support yet for automatically linking work items to the change set created  when checking in as it currently is in Git. Currently this functionality doesn't exist for TFVC Check ins, at the time I didn't think anything of it but tonight for some reason I thought "hey that would be something simply to create and should hopefully make lives easier for developers". So I opened up Visual Studio and at the same time started a new project on GitHub for TFS Server Plugins. The code required for the plugin was very basic, basically just checked the comment from the check in with a regular expression and then added the links between the change set and all the IDs found in the comments.

Example

If you have a comment that says "Changed all site references from Team Foundation Service to Visual Studio Online for item #365", this will when checked in go and try find a work item with the id 365 and if found it will add a link between work item 365 and the check ins change set number.

Getting the code

The code can be found on GitHub at https://github.com/Gordon-Beeming/TFS.ServerPlugins. Just download and compile the TFS.AutoAttachWorkItemIDs project and then copy the TFS.AutoAttachWorkItemIDs.dll and TfsApi.dll into the Plugins folder on your TFS server which is C:\Program Files\Microsoft Team Foundation Server 12.0\Application Tier\Web Services\bin\Plugins for TFS 2013.

What version of TFS will this work with?

This plugin will work with most of the latest TFS version however you will need to retarget the references for versions before TFS 2013.

Downloading the binaries

You can download the compiled binaries targeting 2013 assemblies from http://sdrv.ms/1aKeTbk.

 

Happy Deving Smile