Share via


Export and Import Work Item Types from an Existing Project

To customize work item types on an existing project, you use the witadmin command-line tool to export and import the work item type to an XML file.

Topic Contents

  • Export a Work Item Type Definition File

  • Import a Work Item Type Definition File

Required Permissions

To perform this procedure, you must be a member of the Team Foundation Administrators group or a member of the Project Administrators group for the project. For more information, see Team Foundation Server Permissions.

Export a Work Item Type Definition File

To export a work item type definition file from an existing team project

  1. Open a Command Prompt window.

  2. Change to the directory that contains the work item types that you want to list, by typing the following command and then pressing Enter.

    cd ..Drive:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\IDE

  3. Export a work item type for an existing team project by typing the following command at the command prompt, and then pressing Enter.

    witadmin exportwitd /collection:http://ServerName:Port/VirtualDirectoryName/CollectionName /p:projectName /n:WorkItemTypeName /f:FileName
    

    Note

       If you are running Windows Vista you might not have permissions set for certain folders. If you try to export the work item type to a location where you do not have permissions set, the registry virtualization technology automatically redirects the exported file and saves it to the virtual store. To avoid this redirection, you can export the file to a location where you have permissions set. For more information about registry virtualization, see the following pages on the Microsoft Web site: Registry Virtualization and Common file and registry virtualization issues in Windows Vista.

    For example, the following command exports the contents of the work item type named Bug defined for the AdventureWorks project to the Bug.xml file:

    witadmin exportwitd /collection:http://AdventureWorksServer:8080/AWTeam/Collection1 /p:AdventureWorks /n:Bug /f:Bug.xml
    

    Upon successful completion, the following appears:

    Operation complete.

Import a Work Item Type Definition File

To import a work item type to an existing team project

  1. Open a Command Prompt window.

  2. Change to the directory that contains the work item types that you want to list, by typing the following command and then pressing Enter.

    cd ..Drive:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\IDE

  3. Import a work item type by typing the following command at the command prompt, and then pressing Enter.

    witadmin importwitd /collection:http://ServerName:Port/VirtualDirectoryName/CollectionName /p:projectName /n:WorkItemTypeName /f:FileName
    

    For example, the following command imports the work item type defined in the AWBug.xml file to the AdventureWorks project:

    witadmin importwitd /collection:http://AdventureWorksServer:8080/AWTeam/Collection1 /p:AdventureWorks /f:AWBug.xml
    

    Upon successful completion, the following appears:

    The work item type import has been completed.

    Note

    Importing a work item type definition creates a work item type based on the name assigned to the WORKITEMTYPE element in the type definition file. If the name already exists, the import command will overwrite the existing work item type. If the name does not exist, then a new work item type is added to the tem project.

See Also

Reference

Customizing and Managing Work Item Types [witadmin]