Managing Mappings Between an Enterprise Project and a Team Project

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 perform several tasks that include associating an enterprise project plan with a team project. For an overview of how to integrate these two products, see Configuring the Integration of Team Foundation Server and Project Server.

You can manage the association of enterprise project plans with team projects in Team Foundation Server by using the following commands in the TfsAdmin ProjectServer command-line tool:

  • /MapPlanToTeamProject: Maps an enterprise project plan to a team project. You can map multiple plans to the same team project, but you can map each plan to only one team project.

  • /GetMappedProjects: Returns the list of enterprise project plans that are mapped to any team project in the team project collection that you specify.

  • /UnmapPlanFromTeamProject: Removes the mapping between an enterprise project plan and a team project.

Note

After you map an enterprise project plan to a team project, you can change the types of work items that will be synchronized. For more information, see Managing the Types of Work Items Available for Synchronization.

To use the TFSAdmin command-line tool, you open a Command Prompt window on a computer that is running Team Explorer and Service Pack 1 for Visual Studio Team Foundation Server 2010. You run the tool from the following directory: 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 for the team project collection. 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 Web site: User Access Control.

Syntax

TfsAdmin ProjectServer /GetMappedProjects /collection:tpcUrl

TfsAdmin ProjectServer /MapPlanToTeamProject /collection:tpcUrl /enterpriseProject:EnterpriseProjectName /teamProject:TeamProjectName [/workItemTypes:ListOfWorkItemTypes] [/noFixedWork] [/projectFieldForWorkItemType:ProjectFieldName] [/skipUIChanges]

TfsAdmin ProjectServer /UnmapPlanFromTeamProject /collection:tpcUrl /enterpriseProject:EnterpriseProjectName /teamProject:TeamProjectName [/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 is used, you specify the URL in the following format:

http://ServerName:Port/CollectionName

/enterpriseProject:EnterpriseProjectName

Specifies the name of an enterprise project plan. The plan must be stored and published on Project Server, and the instance of PWA must be registered with the deployment of Team Foundation Server where the project collection is stored.

/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 item to support an Agile process as "User Story,Task" or "User Story",Task Do not include a space after the comma.

/noFixedWork

Specifies that the task type in Project Professional should not be automatically set to Fixed Work for tasks that are mapped to work items in Team Foundation. By default, as part of the integration between the two server products, tasks in the enterprise project plan that are mapped to work items in Team Foundation have their task type set to Fixed Work. You can override this behavior by using this switch. Fixed work is one of three types of tasks that you can use in Project. For more information, see Change the task type Project uses to calculate task duration.

/projectFieldForWorkItemType: ProjectFieldName

Specifies the name of the Microsoft Project field in which to display the value for the work item type that is defined in Team Foundation. You should specify a value between pjTaskText1 and pjTaskText30. By default, the value is pjTaskText30.

/force

Removes all mappings for all work items that are defined in the team project and currently linked to a project plan. An unmapped team project cannot contain any linked work items. You should specify this option only if you are sure that you no longer want any work items in the team project to continue to participate in data synchronization.

/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 help

Displays information about the command.

Back to top

Remarks

When you run a command, a message appears and indicates the action that is being performed and the object that is being acted upon. For example, the following message states that the enterprise project plan is being mapped:

Mapping enterprise project EntProjA . . . Done.

Another message appears after the command finishes. For example, the following message indicates that the enterprise project plan has been mapped to the team project:

Mapping enterprise project EntProjA to team project MyTeamProj . . . Done.

In addition to associating the enterprise project plan with the team project, the /MapPlantoTeamProject option adds the Project Server tab to the work item forms for the types of work items that you specify.

If you try to map an enterprise project to a team project for which no fields have been mapped, a message indicates that a mapping is required, and no more operations are performed. For more information, see Customizing the Field Mapping Between Project Server and Team Foundation Server.

If you remove the mapping between an enterprise project and a team project to which no other enterprise projects are mapped, the Project Server tab is removed from the forms for all work item types in the team project that you unmapped.

Before you unmap a team project, you must remove the association between tasks in the enterprise project plan and work items in Team Foundation. You can remove this association by deleting the tasks from the enterprise project plan, publishing the plan, and waiting for synchronization to complete. As an alternative, you can use the /force flag to remove the association between project tasks and work items.

Tip

Before you delete the tasks, you may want to copy them to another plan to record the tasks that you are deleting.

Back to top

Examples

Unless otherwise specified, the following values apply in each example:

  • URL for the instance of PWA: http://MyPWAServer/MyPWAInstance/

  • URL for Team Foundation Server: http://AdventureWorksServer:8080/tfs/

  • URL for the team project collection: http://AdventureWorksServer:8080/tfs/Collection0

List Enterprise Projects That Are Mapped

The following example lists the enterprise projects that are mapped to a team project in Collection0 on AdventureWorksServer.

TfsAdmin ProjectServer /GetMappedProjects /collection:http://AdventureWorksServer:8080/tfs/Collection0

Map an Enterprise Project to a Team Project

The following example maps MyEnterpriseProjA to MyTeamProjB in Collection0 on AdventureWorksServer and specifies that user stories and tasks will participate in synchronization.

TfsAdmin ProjectServer /MapPlanToTeamProject /collection:http://AdventureWorksServer:8080/tfs/Collection0/ enterpriseProject:MyEnterpriseProjA /teamProject:MyTeamProjB /workItemTypes:"User Story, Task"

Remove Mapping of an Enterprise Project to a Team Project

The following example removes the association of MyEnterpriseProjA to MyTeamProjB in Collection0 on AdventureWorksServer.

TfsAdmin ProjectServer /UnmapPlanFromTeamProject /collection:http://AdventureWorksServer:8080/tfs/Collection0/ enterpriseProject:MyEnterpriseProjA /teamProject:MyTeamProjB

Back to top

See Also

Tasks

Configuring the Integration of Team Foundation Server and Project Server

Concepts

Managing Project Server Integration with TFSAdmin ProjectServer

Change History

Date

History

Reason

June 2011

Corrected the capitalization of several command switches.

Content bug fix.