Jon Gallant

Solution: TFS always shows ChangedBy as the current user

2 min read

By default TFS always displays the System.ChangedBy field as the current user. I am Jon Gallant and Wallace Breza is a dev on my team. As you can see he was the last to change the bug, but my name is in the System.ChangedBy field.

0755.image 5F00 thumb 5F00 4B861A98

This is happening because the work item is put into Edit mode when it is opened and that includes setting the System.ChangedBy field to currentuser. I talked with the TFS Work Item here and they have logged a bug.

Here’s the workaround I’m using.

  1. Install the TFS Power Tools.

  2. Open the Work Item Template from Tools –> Process Editor –>Work Item Types –> Open WIT from Server

8780.image 5F00 thumb 5F00 002676D4

  1. Select the Work Item Type you want to update

5164.image 5F00 thumb 5F00 1FD5509C

  1. In the Fields tab click New

3005.image 5F00 thumb 5F00 3F842A64

  1. Enter the following information:

Name: LastChangedBy Type: String Reference Name: YourOwnNamespace.LastChangedBy Help Text: Whatever you want to put in here Reportable: Dimension

5460.image 5F00 thumb 5F00 3145B174

  1. Click the Rules tab

  2. Click the New button:

  3. Select COPY. Click OK

6153.image 5F00 thumb 5F00 0A0B683F

  1. Set the following values:

From: field Field: System.ChangedBy

8204.image 5F00 thumb 5F00 10BE71C2

  1. Click OK

  2. Click the Layout tab

  3. Click on the Changed By field in your Layout tree.

  4. Over in the details pane to the right, change the “Field Name” property to YourOwnNamespace.LastChangedBy.

8875.image 5F00 thumb 5F00 650DA7C5

  1. Save the WIT.

  2. Click the Refresh button in Team Explorer

8284.image 5F00 thumb 5F00 3DD35E90

  1. Close all your open documents, bugs, queries, etc. There is a local cache that won’t reflect the changes unless you close and reopen.

  2. Open up a bug and see that Changed By now equals the last person that changed the bug.

0777.image 5F00 thumb 5F00 7D9D4515

Hope this helps, Jon

Share:
Share on X