category: [ VSTS / TFS ] tags: [ GitHub Projects ] [ TFS ] [ TFS Customisations ] [ TFS Server Plugins ] [ VSTS / TFS ]
created: 16 Nov 2013 @ 21:08 modified: 24 Apr 2017 @ 13:57
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.
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.
Gordon Beeming works at Nologo Studios in the sunny city of Durban, South Africa. He is the Lead for the Data and Services Team and has a strong focus on Developer Efficiencies and R&D. When he's not hacking away at a keyboard in Visual Studio he'll generally be relaxing with his family or hitting the black top getting in some mileage. He is a Visual Studio ALM Ranger and Visual Studio ALM MVP.