March 1, 2023
I recently had a team ask me about changing the default check in option from Resolve to Associate in Team Foundation Server 2012 (TFS 2012). I did some research and found there is a lot of confusion around the available options. I am going to describe the two main options to help you decide which option will work best for you and your team. So, why is changing this important? Our Lunavi ALM Delivery Guidance recommends that each person should update his/her tasks before stand-up each day. We also recommend the hours be zeroed out for completed tasks, however the task should be left open until stand-up. During the stand-up the task will be moved from Active to Closed where the team can celebrate the victory. I have seen teams use clapping, snaps, and noise makers to name a few. When developers check-in his/her code, they should always associate the check-in to the appropriate work item(s) but not choose Resolve. Resolve is the default option but by choosing this, it will automatically close the Task bypassing being able to close it during the stand-up.
Changing the option to Associate each time seems small but it would be nice to change the default option from Resolve to Associate. In TFS 2010 it was relatively simple to change this by updating a registry key. However, in TFS 2012 there are two options that address this in different ways. Both options have some drawbacks. I will explain the two options and let you make the decision which you prefer.
One way to address this is to remove the Check-In action from each WIT. Using the TFS Power Tools, you can remove the Action from the Transition. In the Task, you need to remove it from the New –> Closed and the Active –> Closed transitions. To do this, double click on the Transition title bar to open the Workflow Transition dialog. Navigate to the Actions tab and delete the Action. In addition to the Task, you should also remove this from the Bug WIT since these are the two types of work items that you would typically associate your check-ins to.
Once the WITs have been updated into your team project this will be available for all users. Now when you add a related work item, the only option available is Associate.
As I mentioned, this solution has some pros and cons. Here is a few to consider:
Pros
Cons
This option sounds good. Unfortunately it only works under one scenario. With the Team Explorer 2012, there are two primary ways to initiate a check in. You can initiate the check in from the Pending Changes Pane and from My Work Pane. By default if you initiate the check-in from either location, the default option will be Resolve. Once this fix has been applied, it will update the default option when initiating the action from the My Work pane but not the Pending Changes Pane. I will show you how to set this up but first I will show you the scenario that doesn’t work and the one that does work.
From my experience, most check-ins are initiated from the Pending Changes pane or by right clicking on a location in Solution explorer. Either way you will end up on the Pending Changes pane, where you can associate a work item by query or by ID. Unfortunately the change has no effect on this and will continue to default to the Resolve option as shown below.
In Team Explorer 2012, there is a new Pane called My Work. This Pane is designed to group and manage all of your current work including code, break points, and associated work items. This provides the ability to suspend/resume your current work so you can switch to work on something else and then come back to it later with everything the way you left it. After applying the update, initiating the check-in from here will change the default option to Associate.
Now that you understand the scenarios. To enable this option, each Visual Studio user will need to update the following registry key and change ResolveAsDefaultCheckinAction = False.
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\TeamFoundation\SourceControl\Behavior
Next, exit all instances of Visual Studio 2012. Open the Developer Command Prompt for VS 2012 with administrator privileges. Run devenv /setup to ensure that the registry is picked up by Visual Studio.
With the change applied, the default option is changed for your My Work initiated check ins. For this option, here are several pros and cons:
Pros
Cons
As you can see there isn’t a perfect option. Hopefully this gives you a complete picture of the options so you can make the best decision for your team. We chose the first option because the Resolve option would be rarely used.
Mike