Updating Associated Changesets and Work Items without Updating Work Items

In Team Build 2008 when you disabled updating work items as part of the build Team Build still listed the associated changesets and work items in the build detail. In Team Build 2010 you cannot turn off the updating of work items independently so setting the Update Associated Changesets and Work Items parameter to false will cause the work items to not be updated and the associated changesets and work items to not be listed in the build detail.

Yesterday I was asked if it was possible to control this behavior and while it isn’t by default you can enable this scenario with minor modifications to DefaultTemplate.xaml (which is in $/TeamProject/BuildProcessTemplates). By making these changes we modify the behavior of the “Update Associated Changesets and Work Items” parameter to just enable/disable the updating of work items so that the changesets and work items are always associated with the build.

  1. Move the "Associate Changesets and Work Items for non-Shelveset Builds" activity outside of the "If AssociateChangesetsAndWorkItems" activity (either before or after it).
  2. Delete the now empty "If AssociateChangesetsAndWorkItems" activity.
  3. Select the "AssociateChangesetsAndWorkItems" activity inside the "Associate Changesets and Work Items for non-Shelveset Builds" activity and in the properties change the "UpdateWorkItems" property from "True" to "AssociateChangesetsAndWorkItems" (without the quotes).

The end result should look like this:

clip_image001