How to: Rename a Work Item Type Field
You can use the command-line tool witfields to rename work item type fields for an existing project from the Visual Studio 2008 command prompt. For more information, see witfields.
To view a list of work item type fields available on your Team Foundation Server, see How to: View a Work Item Type Field.
To perform this procedure you must be a member of the Team Foundation Administrators group or a member of Project Administrators group for all projects where the field is used. For more information, see Team Foundation Server Permissions.
To use Team Foundation commands at the command prompt
Click Start, click All Programs, point to Microsoft Visual Studio 2008, point to Visual Studio Tools, and then click Visual Studio 2008 Command Prompt.
Alternatively, you can run vsvars32 in the Visual Studio installation path; usually DriveLetter:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools.
You must have Visual Studio installed to use the Visual Studio 2008 Command Prompt.
To rename fields
Open a Visual Studio command prompt.
Change directory to the location of the assembly that contains the work item types, by typing the following command, and then pressing ENTER.
cd ..DriveLetter:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies
At the Visual Studio command prompt, type the following, and then pressing ENTER.
witfields rename /s:"<Team Foundation Server name>" Microsoft.VSTS.Common.Rank Importance
This command renames the Rank field to Importance.
At the confirmation prompt type y and then press ENTER. Wait until you receive the following message:
In the Team Explorer window in Visual Studio, click Refresh to download the latest updates from the server.
Wait several seconds until all the nodes are loaded. Nodes that are still loading display working.
Right-click the Work Items node, and then select Add Query to create a new query.
Click the area labeled Click here to add a clause to add a new row, select the blank Field cell, and in the cell, type Rank. Notice the following message that appears above the results list. This message indicates that the Rank cannot be found.
Run the query to see the query results. TF51005: The query references a field that does not exist. The error is caused by <<Rank>>.
Delete the value Rank from the Field cell, and type Importance into the cell.
Select <> in the Operator cell, and type 1 into the Value cell.
From the Team menu, click Run Query.
Right-click any row in the results and select Column Options. Scroll down in the Available columns list. Notice that the Rank field is no longer present but the Importance field is present.
Select Importance in the Available columns box, and then click the add selected columns button, (>). Click OK.
Notice that the friendly name for Microsoft.VSTS.Common.Rank has been renamed from Rank to Importance throughout the query builder and results list.
Click Close to close the query. Click No when you are prompted to save the query.
Create a new Task work item. To do this, right-click the Work Items node, point to Add Work Item, and then click Task.
This work item is created from the work item type that you changed and imported.
Notice, in the Status box, that the label for the renamed field, Rank, has not changed. This is because the field labels on the work item forms are scoped to the parent team project and are independent of the server-wide field name just specified.
For more information about how to change field labels on work item forms, see How to: Customize a Field Label.
Click Close to close the new Task. Click No when you are prompted to save the work item.