Managing Global Workflow [witadmin]
By using global workflow, you can minimize the work required to define and update work item fields and global lists that are multiple team projects and types of work items share. With global workflow, you can define and update fields and global lists. You can manage the global workflow for a team project collection or a team project by using the following commands in the witadmin command-line tool:
exportglobalworkflow: Exports the global workflow to an XML file or the Command Prompt window.
importglobalworkflow: Imports global workflow from an XML file.
Before you can define a global workflow, the feature must be enabled on the application-tier server. Therefore, the server must be running a version of Visual Studio Team Foundation Server, such as Team Foundation Server 2010 with Service Pack 1 (SP1), that supports this feature. You can download the service pack from the following page on the Microsoft website: Service Pack 1 of Visual Studio Team Foundation Server 2010, Beta.
You can find the witadmin command-line tool in Drive:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE on any computer that runs Team Explorer. For 64-bit machines, the tool is in Drive:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE.
For more information about global workflow, see Customizing Global Workflow.
For the team project collection where the global workflow is defined, you must have the following permissions set:
To export a global workflow, you must be a valid user of the team project or collection.
To import a global workflow, you must be a member of the following security groups: Team Foundation Administrators, Project Administrators to import a global workflow to a team project, or Project Collection Administrators to import a global workflow to a collection.
For more information, see Team Foundation Server Permissions and Team Foundation Server Default Groups, Permissions, and Roles.
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, click Start, right-click Command Prompt, and then click Run as Administrator. For more information, see the following page on the Microsoft website: User Access Control.
witadmin exportglobalworkflow /collection:CollectionURL [/p:ProjectName] [/f:FileName] [/e:Encoding] [/exportgloballists]
witadmin importglobalworkflow /collection:CollectionURL [/p:ProjectName] /f:FileName [/e:Encoding] [/v]
Specifies the URI of the collection. You must specify the URI in the following format: http://ServerName:Port/VirtualDirectoryName/CollectionName
If you do not specify a virtual directory, you must specify the URI in the following format:
Optional. The team project for which you want to export or import the global workflow. This team project must be defined in the collection that you specified by using the /collection parameter. If you do not specify a team project, the global workflow is imported or exported for the collection.
The path and the name of the XML definition file for global workflow to export or import.
If the client computer is running Windows Vista, you may not have permissions to certain folders. If you try to export the global list to a location where you do not have permissions, the registry virtualization technology automatically redirects the exported file and saves it to the virtual store. For more information, see the following pages on the Microsoft web site: Registry Virtualization and Common file and registry virtualization issues in Windows Vista. To avoid this redirection, you can export the file to a location where you have permissions.
Optional. The name of a .NET Framework 2.0 encoding format. The specified encoding will be used to export or import the XML data. For example, /e utf-7 specifies Unicode (UTF-7) encoding. If you omit this parameter, witadmin attempts to detect the encoding and uses UTF-8 if detection fails.
Optional. Validates the XML that defines the global workflow but does not import the definition file.
Optional. Exports the definitions of global lists that the global workflow references. The definitions for global lists will be embedded into the XML definition of the global workflow. If you do not specify this parameter, the definitions for global lists are omitted.
/? or help
Displays help about the command in the Command Prompt window.
You can define work item fields by importing them through a global workflow. However, you cannot change the properties of existing fields by using global workflow. If you import a global workflow that does not contain a FIELDS element, all previously imported rules for global workflow will be deleted. Field definitions will not be affected.
Unless otherwise specified, the following values apply in each example:
URI for the collection: http://AdventureWorksServer:8080/AWTeam/Collection1
Team project: Contoso
Port number for the server website: 8080
Export the Definition of a Global Workflow for a Team Project
The following example exports the global workflow for a team project:
witadmin exportglobalworkflow /collection:http://AdventureWorksServer:8080/AWTeam/Collection1 /p:Contoso /f:C:myGlobalWorkflow.xml
Import the Definition of a Global Workflow to a Team Project
The following example imports the global workflow to the Contoso team project:
witadmin importglobalworkflow /collection:http://AdventureWorksServer:8080/AWTeam/Collection1 /p:Contoso /f:C:collectionGlobalWorkflow.xml
Import the Definition of a Global Workflow to a Collection
The following example imports the global workflow to the collection:
witadmin importglobalworkflow /collection:http://AdventureWorksServer:8080/AWTeam/Collection1 /f:C:collectionGlobalWorkflow.xml