Integrating TeamCity and Visual Studio Online Work Items

Continuous Integration only makes sense if there’s an easy way to verify the quality of our codebase and when we can easily correlate builds with our issue tracker and the source code itself. Out of he box, TeamCity provides integration with YouTrack, JIRA and Bugzilla. We can also install plugins to integrate with other issue trackers like GitHub and FogBugz. Today, we’re happy to announce another issue tracker integration: the Visual Studio Online Work Items plugin.

We’ve already blogged about how we can link Visual Studio Online source control with TeamCity and run our builds.When using Visual Studio Online (VSO) as an issue tracking system as well, we can use the Work Items plugin to provide a direct link between the build and version control history in TeamCity and the Work Items that were associated with them.

Work Item integration with TeamCity

How does it work?

After installing and configuring the Visual Studio Online Work Item plugin, TeamCity will parse version control check-in messages and transforms the Work Item ID into a link that brings us to the full work item. A direct link will be available on the Changes tab of our build results. The Issues tab will show us a list of all Work Items that are associated with the build. And in the build configuration home page, we can also review Work Items mapped to comments from the Issue Log tab.

Work Item link in Changes

The plugin does not look at the Work Item Association, but instead uses the check-in message to provide these links. This has a big advantage: it works with both Team Foundation Version Control (TFVC)-based projects as well as the increasingly popular Git-based projects. This does mean we have to keep two things in mind:

  • When checking-in changes, always mention the related Work Item ID in the check-in comments.
  • On the Issue Log tab of a build, we can tick the Show only resolved issues option to only display issues that were fixed in the build. This does mean we have to resolve Work Items when they are fixed.

How to configure it?

To enable integration, we need to first install the Visual Studio Work Items plugin. Next, we have to create a connection to our Visual Studio Online project from the Administration | Issue Tracker page. After selecting the Visual Studio Online connection type, we have to provide a display name, our Visual Studio Account name, and a username and password to connect to it. Do make sure to enable alternate credentials in Visual Studio Online!

We also have to provide the collection, the project name and the issue pattern to detect. The default is #(\d+), which will recognize Work Item IDs that look like #10, #99 and so on. We can customize this so we can detect other patterns. The Test Connection button lets us verify all connection details are correct.

Visual Studio Online configuration

Once saved, TeamCity starts to match each Work Item ID it recognizes in the project’s check-in history.

Happy building!

About Maarten Balliauw

Maarten Balliauw is a Developer Advocate at JetBrains, working on .NET tools. He focuses on .NET, Azure, web technologies and application performance. Maarten is a frequent speaker at various national and international events. In his free time, he brews his own beer. Follow him on Twitter or check his personal blog.
This entry was posted in Features, Tips&Tricks and tagged , , , . Bookmark the permalink.

4 Responses to Integrating TeamCity and Visual Studio Online Work Items

  1. Sebastian says:

    I’m having trouble with this plugin. Under issue tracker, I get VisualStudioOnline as an connection type. When I select that option, nothing happens, no input fields appear. Any suggestions on how to get around this issue?

  2. Oleg Rybak says:

    We have found and fixed an issue with tracker settings not displaying on *nix systems. Please take stable build as indicated on plugin page

  3. André Minelli says:

    When this plugin will support TC 9.0? The build configuration on public TC server only has builds for TC 8.0….

Comments are closed.