As the Visual Studio family of products (Visual Studio, TFS, Test Professional) nears its 2012 release, I thought I’d bring some short hits – tidbits, if you will – to my blog. Some of these are pretty obvious (well-documented, or much-discussed), but some may be less obvious than you’d think. Either way, it’s always good to make sure the word is getting out there. Hope you enjoy!

Merging Changes by Work Item

This is something that existed in VS 2010, but it wasn’t talked about as much.  While it’s pretty straightforward to track changes merged across branches by changeset, sometimes it’s even more effective to track merges by work item (i.e. show me where changes associated with a work item have been merged/pushed to other branches).

Let’s catch up. Consider the relatively simple branch hierarchy below:

image

A work item has been assigned to Julia, Task #80.

image

Julia makes some code changes, and checks in against (linking to) the work item (Task #80).

She checks in 2 individual changes to create links to 2 discrete changesets from the task.

Now, it’s easy to go ahead and track an individual changeset by selecting the option from the History window.

image

That’s all well and good, but if I didn’t know the exact changeset ID (#17), or if there was more than one changeset in associated with the task, this tracking process becomes less effective.

What Julia can do is right-click on the work item and select “Track Work Item”.    (Note that this option will be disabled if there are no changesets linked to the work item.)

image

She can also click the “Track Work Item” button at the top of the work item form:

image

I get a much clearer picture now of all the work and where it’s been applied, and the “Tracking” visualization will now include all changesets (in my case, 2 changesets) in the window.

Now I know exactly what changes to merge.  I merge them, and now I can see that the entire work item has been merged to Main from Dev (i.e. both changesets were merged).

image

And just as effectively, I can see these changes in the Timeline Tracking view:

image

So that’s it! Tracking by work items are pretty easy to do, and paint a much clearer picture of how a change from a work item perspective can, or has been, applied across branches.

Again, I know this isn’t exactly a new feature, but there are a lot of people out there who are looking for ways to “merge by work item” and aren’t aware of this feature.