Share via


Managing the Types of Work Items Available for Synchronization

Before you can synchronize data between Visual Studio Team Foundation Server 2010 and Microsoft Project Server 2007 with Service Pack 2 (SP2) or Project Server 2010, you must configure the integration of the two server products. As part of the configuration tasks, you must associate an enterprise project plan with a team project, and you must specify the types of work items that will participate in synchronization. After you make your initial configurations and mapping, you can change the types of work items that are mapped.

You can manage the types of work items that participate in synchronization by using the following options of the TfsAdmin ProjectServer command-line tool:

  • /MapWorkItemTypes: Defines the types of work items that can participate in synchronization for a team project. Although you can map several types, only those work items that are submitted for publishing are synchronized.

  • /GetMappedWorkItemTypes: Returns the list of work item types that are configured to participate in synchronization for a team project.

  • /UnmapWorkItemTypes: Removes work item types from participating in synchronization for a team project.

For an overview of how to integrate the two server products, see Configuring the Integration of Team Foundation Server and Project Server. For an overview of how to associate an enterprise project with a team project, see Managing the Association of Enterprise Projects to Team Projects.

To use the TfsAdmin ProjectServer command-line tool, you open a Command Prompt window on any computer that is running Team Explorer and Service Pack 1 for Visual Studio Team Foundation Server 2010. You run the tool from Drive:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE. For 64-bit machines, the tool is in Drive:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE.

Required Permissions

To use these commands, your Administer Project Server integration permission must be set to Allow. Also, the service account for Team Foundation Server must be granted the necessary permissions to interact with the instance of PWA that will participate in data synchronization. For more information, see Assigning Permissions to Support Integration of Project Server and Team Foundation Server.

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, 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.

Syntax

TfsAdmin ProjectServer /GetMappedWorkItemTypes /collection:tpcUrl teamProject:TeamProjectName

TfsAdmin ProjectServer /MapWorkItemTypes /collection:tcpUrl /teamProject:TeamProjectName /workItemTypes:ListOfWorkItemTypes [/skipUIChanges]

TfsAdmin ProjectServer /UnmapWorkItemTypes /collection:tpcUrl /teamProject:TeamProjectName /workItemTypes:ListOfWorkItemTypes [/force]

Parameters

Parameter

Description

/collection:tpcUrl

Specifies the uniform resource locator (URL) of a team project collection. You specify the URL in the following format:

http://ServerName:Port/VirtualDirectoryName/CollectionName

If you do not specify a virtual directory, you specify the URL in the following format:

http://ServerName:Port/CollectionName

/teamProject:TeamProjectName

Specifies the name of a team project that is defined in the project collection.

/workItemTypes:ListofWorkItemTypes

Specifies, in a comma-delimited list, the reference names of one or more types of work items. You should specify only those types of work items whose data you want to track in Project Professional. For example, you can specify the following types of work items to support an Agile process as “User Story,Task” or “User Story”,Task. Do not include a space after the comma.

/skipUIChanges

Specifies that the Project Server tab in the work item form should not be changed for the types that you specify. You should include this flag if you have customized the Project Server tab for the affected types or the MapWorkItemTypes command cannot complete. You can manually update a type definition. For more information, see XML Elements Added to the Definition for the Work Item Type.

/force

Removes all links that bind work items of the types that you specify to tasks in Project. If you use this option, you can remove types of work items from participating in data synchronization, even if one or more work items of that type that are currently being synchronized.

/? or help

Displays information about the command.

Back to top

Remarks

When you run a command, a message appears that indicates what action is being performed on what object. For example, the following message states that user stories and tasks are being configured to participate in data synchronization.

Configuring synchronization for the following work item types for team project ProjA: User Story, Task. . . 

Another message appears after the command finishes. For example, the following message indicates that user stories and tasks have successfully been configured.

You have successfully configured the following work item types for team project ProjA: User Story, Task.

In addition to configuring the types of work items that can participate in synchronization, the /MapWorkItemTypes command performs the following operations:

  • Adds the types of work items that you specify to the set of types that participate in data synchronization. That is, the command does not unmap any existing mapped types.

  • Adds the Project Server tab to the forms for the types of work items that you specify.

    If a Project Server tab is already defined for a type of work item that you specify, that type is ignored, and no changes are made to the forms for work items of that type.

If you try to map work item types for a team project that is not associated with an enterprise project plan, an error appears. You can map work item types only for team projects that are configured to participate in synchronization. For more information, see Managing the Association of Enterprise Projects to Team Projects.

If you remove the mapping for a work item type, the Project Server tab is removed from the form for that type for the team project that you unmapped.

Before you unmap a work item type for a team project, you should delete the tasks from the enterprise project plan to remove all associations between them and work items in Team Foundation. After you delete the tasks from the enterprise project plan, you must publish it and wait for synchronization to complete. As an alternative, you can specify the /force flag to remove all links that bind work items to tasks for the team project. Only those work items that are of the types that you specify are removed from participating in synchronization.

Tip

If you delete the tasks, you may want to first copy them to another plan to maintain a record of them.

Back to top

Examples

List Work Item Types That Are Mapped

The following example retrieves the types of work items that are configured to participate in synchronization for the Contoso team project in Collection0 on AdventureWorksServer.

TfsAdmin ProjectServer /GetMappedWorkItemTypes /collection:http://AdventureWorksServer:8080/tfs/Collection0 /teamproject:Contoso

Map a Work Item Type for a Team Project

The following example configures user stories and tasks to participate in data synchronization for the Contoso project.

TfsAdmin ProjectServer /MapWorkItemTypes /collection:http://AdventureWorksServer:8080/tfs/Collection0/ /teamProject:Contoso /workitemtypes:”User Story, Task”

Remove Mapping of a Work Item Type for a Team Project

The following example removes tasks from participating in data synchronization for the Contoso project.

TfsAdmin ProjectServer /UnmapWorkItemTypes /collection:http://AdventureWorksServer:8080/tfs/Collection0/ /teamProject:Contoso /workitemtypes:Task

Back to top

See Also

Concepts

Specifying the Work Item Types That Can Be Synchronized

Managing Project Server Integration with TFSAdmin ProjectServer

Other Resources

Customizing the Field Mapping Between Project Server and Team Foundation Server

Change History

Date

History

Reason

June 2011

Added information about how to use the /skipUIChanges and /force switches. Corrected the capitalization of several command switches.

Customer feedback.