Thursday, December 18, 2008

How to Update a Changeset for TFS

There are many reasons why you may need to update a changeset in TFS. If you need to update the comment, please read the post How to Update the comment after check in.

In my environment, I had to do more than this. I have a check-in policy where all changesets must be associated with work items. If the policy is not met, a policy failure can be seen in the changeset reading
You must associate this check-in with one ore more work items. 
This policy can be overridden, but even if you override it, and your changeset is committed, how do you associate a work item with that changeset?

Here is how.
  1. Find the changeset number. You can do this by viewing the history for your project.
  2. Now open a work item that you want to associate with the changeset. 
  3. The work item template should have a "Links" tab. On that tab, "Add" a link.
  4. Set the "Link type" to "Changeset". 
  5. In the "Link details" section, set the "Changeset:" value to the changeset number you looked up a few moments ago. You can also "Browse" for it if you don't like the "History" approach I mentioned above.
  6. Add a meaningful (or meaningless) comment.
  7. Click "OK" 
Now, the changeset doesn't have any policy failures (or at least not related to work items).

No comments: