Tuesday, 15 October 2013

TFS 2013 RC - Rename Work Item Type

How can I rename a Work Item Type in TFS? Is it impossible? Answer is yes you can rename and it is very simple to do it.

Here is the steps you need to do.

Open up the VS Developer Command prompt (If using TFS 2012 use VS 2012 developer command prompt, for TFS 2013 RC use VS 2013 RC command prompt)

  • First list all work item types with the below command
witadmin listwitd /collection:YourTfsServer/VirtualDirecory/TeamProjectCollection /p:YourTeamProject

witadmin listwitd /collection:http://localhost:8080/tfs/DefaultCollection /p:Scrum3RenameTest

  • Then rename the work item type using
witadmin renamewitd /collection:YourTfsServer/VirtualDirecory/TeamProjectCollection /p:YourTeamProject /n:FromWorkItemTypeName /new:ToWorkItemTypeName

witadmin renamewitd /collection:http://localhost:8080/tfs/DefaultCollection /p:Scrum3RenameTest /n:"Feature" /new:"Epic"

I renamed the Feature to Epic. Now when I try to view the backlog in Web Access Below error shows up. TF400917: The current configuration is not valid for this feature

Reset IIS by running resetiis on the command prompt and you are good to go!

Now my Feature work item renamed to Epic and I can add new Epic work items. that is cool...But.. :(

Why but? Still the Menu in left says Features? Can I change that?

Lets see how we can do this change?

Export the ProcessConfiguration xml with below command

witadmin exportprocessconfig /collection:YourTfsServer/VirtualDirecory/TeamProjectCollection /p:YourTeamProject /f:FileNameWithPath

witadmin exportprocessconfig /collection:http://localhost:8080/tfs/defaultcollection /p:Scrum3RenameTest /f:"C:\temp\ProcessConfiguration.xml"

Then open the .xml file in a notepad and change Plural Name  and Singular Name for Feature Category.

After the change import xml with below command (I copied xml and renamed as ProcessConfigurationmodified.xml)

witadmin importprocessconfig /collection:YourTfsServer/VirtualDirecory/TeamProjectCollection /p:YourTeamProject /f:FileNameWithPath

witadmin importprocessconfig /collection:http://localhost:8080/tfs/defaultcollection /p:Scrum3RenameTest /f:"C:\temp\ProcessConfigurationmodified.xml"

Refresh web access

Above message is completely OK, just click on Epics

Now this is really cool.. :)


Anonymous said...

This is really thanks for this. BTW: On [Home] page the button to add [+Item] causes an error. Is there a way to fix that

Martin Rajotte said...

Very useful but make sure you also change the reference to the renamed work item in the WorkItemColors section of the processconfiguration file. I didn't and I'm now facing an error "The given key is not present" See thread http://social.msdn.microsoft.com/Forums/vstudio/en-US/de1c2458-ab33-4939-b39e-372e8ee1529b/importprocessconfiguration-the-given-key-was-not-present-in-the-dictionary?forum=tfsgeneral

Anonymous said...

Nice post, however, I don't see where the "new" work item name is changed in the database. My excel reports are still referring to the original name. Any ideas on how to fix?

Mr Bushmills said...

Great guide - simpleά clear and comprehensive.
Tried this today with TFS 2015 and all commands above are updated. Thank you.

Anonymous said...

Hmm it seems like your site ate my first comment (it was
super long) so I guess I'll just sum it up what I wrote
and say, I'm thoroughly enjoying your blog. I too am an aspiring
blog blogger but I'm still new to everything.
Do you have any tips and hints for beginner blog writers?
I'd certainly appreciate it.