Udostępnij za pośrednictwem


Enable Synchronization of Person-Name Custom Fields

You must manually enable synchronization of any custom work item fields that you have created in previous releases of Visual Studio Team Foundation Server and that are used to assign person names that reference Active Directory. You must enable synchronization for each field for each team project collection that contains the custom fields.

When you upgrade from Microsoft Visual Studio Team System 2008 Team Foundation Server to Visual Studio Team Foundation Server 2010, all system reference fields that show person-names automatically update to have the attribute syncnamechanges set to true. Such fields include System.AuthorizedAs, System.AssignedTo, System.ChangedBy and System.CreatedBy. The upgrade also enables synchronization for each person name field that is defined in one of the default process templates. For more information, see Using System Fields and Fields Defined by the MSF Process Templates

After synchronization is enabled, the field no longer shows a static string. Instead, the field shows the name associated with a user account. When you change the user name in Active Directory or in Workgroup, a field with syncnamechanges set to true automatically shows the new name.

However, the upgrade process cannot change the data type of custom fields that reference person-names. You must manually change the syncnamechanges attribute for each of those fields.

Note

You can enable synchronization only for fields with the data type of String.

Required Permissions

To change the attribute of a field, you must be a member of the Team Foundation Administrators security group. To list information about a field, you must have permissions to connect to Team Foundation Server. For more information, see Team Foundation Server Permissions.

Note

Even if you log on with administrative permissions, you must open an elevated Command Prompt window to perform this function on a server that is running Windows Server 2008. To open an elevated Command Prompt window, choose Start, right-click Command Prompt, and then choose Run as Administrator. For more information, see the Microsoft Web site: User Account Control.

To verify the data type of the field that you want to convert

  1. To run the witadmin command-line tool, open a Command Prompt window where either Visual Studio or Team Explorer is installed and type:

    cd %programfiles%\Microsoft Visual Studio 10.0\Common7\IDE
    

    On a 64-bit edition of Windows, replace %programfiles% with %programfiles(x86)%.

  2. Type the following command, substituting your data for the arguments that are shown here, where CollectionURL specifies the URL of a team project collection and FieldName specifies the reference name of a field. Then choose Enter.

    witadmin listfields /collection:CollectionURL /n:FieldName 
    

To enable synchronization for a String field that contains person names

  1. Type the witadmin command that uses the following syntax, and then choose ENTER:

    witadmin changefieldtype /collection:CollectionURL /n:FieldName /syncnamechanges:true
    

    The following confirmation prompt appears:

    This will change properties for field {0} on the Team Foundation Server. Do you want to continue?

  2. Type 0 to confirm that you want to change the field, or 1 to cancel the request.

    If the change request succeeds, the following confirmation message appears:

    The field was updated.

    If the change request fails, an error message appears. The most common mistakes that can be made are trying to change a system reference field, or trying to change a field of a data type other than String. These operations are not supported.

See Also

Reference

Managing Work Item Fields [witadmin]

Concepts

What's New in Tracking Work Items

Other Resources

Index to XML Element Definitions for Types of Work Items

Change History

Date

History

Reason

June 2011

Corrected the syntax for the witadmin commands.

Content bug fix.