Upload or download the Microsoft Project Mapping file
Updated: July 15, 2016
Use TFSFieldMapping to upload and download the Microsoft Project mapping file. This file controls how Microsoft Project publishes tasks to a team project that connects to an on-premises Team Foundation Server (TFS). For example, you can modify the file to support fields you added to work item types or modify the way in which existing fields are published and refreshed.
You can specify which TFS fields map to Project fields. You can also control publishing behavior through the PublishOnly attribute, and designate special fields such as the context field. For the complete XML syntax of the mapping file, see Customize the Microsoft Project field mapping file. This file is the same file that was defined in the process template that was used to create the team project. See Map Microsoft Project fields to Team Foundation fields
The TFSFieldMapping command-line tool only works when run against an on-premises TFS. To run the tool, open a Command Prompt window where either Visual Studio or Team Explorer is installed and enter:
cd %programfiles%\Common Files\microsoft shared\Team Foundation Server\14.0
Even if you are logged on with administrative permissions, you must open an elevated Command Prompt to perform this function on a server that is running Windows Server 2008. To open an elevated Command Prompt, choose Start, open the context menu for Command Prompt, and then choose Run as Administrator. For more information, see the Microsoft Web site.
To use the TFSFieldMapping command, you must be a member of the Team Foundation Administrators or the Project Administrators security group. For more information, see Permission reference for Team Foundation Server.
upload | download
Specifies whether to download or upload the field mapping file.
Specifies the URI of the team project collection in the following format: http://ServerName:Port/VirtualDirectoryName/CollectionName
If you do not specify a virtual directory is used, you must use the following format:
If you have previously connected to the server, you can specify the friendly name for the server instead of the URI.
Specfies the name of the team project whose mapping parameters you want to modify. If the name contains spaces, enclose it in quotation marks.
Specifies the name and file path of the mapping file.
Open a Command Prompt window where you have installed Project and either Team Explorer or TFS and enter:
cd %programfiles%\Common Files\microsoft shared\Team Foundation Server\12.0
Project isn't required to download the mapping file, however, it is required to upload it.
Download the mapping file by entering the following command:
TFSFieldMapping download /collection:CollectionURL /teamproject:ProjectName /mappingfile:MappingFile
If a name contains spaces, enclose the name in quotes.
Open the mapping file in a text editor or XML editor.
Add new mappings or edit existing mappings in the following format:
<Mapping WorkItemTrackingFieldReferenceName="System.Id" ProjectField="" ProjectName="" ProjectUnits="" PublishOnly="" IfSummaryRefreshOnly=""/>
For example, to add additional scheduling fields to a team project created using the Scrum process template, add the following mappings:
<Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Scheduling.StartDate" ProjectField="pjTaskStart" PublishOnly="true" /> <Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Scheduling.FinishDate" ProjectField="pjTaskFinish" PublishOnly="true" /> <Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Scheduling.OriginalEstimate" ProjectField="pjTaskBaselineWork" ProjectUnits="pjHour" IfSummaryRefreshOnly="true" /> <Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Scheduling.CompletedWork" ProjectField="pjTaskActualWork" ProjectUnits="pjHour" IfSummaryRefreshOnly="true" />
The default Scrum template only maps the Remaining Work field to Project.
For a full list of all the Office Project field values for the ProjectField attribute, see Field mappings in Microsoft Project.
(Optional) Indicate if the field is to be published but not refreshed. Add the PublishOnly attribute to the mapping section for that field and set the attribute to true. This attribute can be used to allow for team members to see a field value but not be able to change it in Team Foundation.
(Optional) Indicate how summary tasks are to be refreshed in Project. Add fSummaryRefreshOnly="true" attribute to indicate that the field is never published to the work item database but is refreshed from the work item database when the row for the field is a summary task in Project, the summary task has Publish and Refresh=Yes, and the summary task contains at least one child task that is published to TFS.
Save and upload the file:
TFSFieldMapping upload /collection:CollectionURL /teamproject:ProjectName /mappingfile:MappingFile