Good,
today a tutorial type post to show how to synchronize aĀ Microsoft ProjectĀ field with a field of a definition of a WorkItem of Team Foundation Server.Ā For this example I added a field to the definition of a Task called “ElBruno.WbsCode” (if you don’t know how to doĀ this postĀ can help you).Ā The idea for this post is to synchronizeĀ Microsoft ProjectĀ WBS with this new field of the Task field.
For this we follow the following steps.
Tutorial
1. Open a command prompt inĀ Visual Studio 2010.
2. Download the file mapping with a command similar to the following:
C:\Program Files (x 86) \Microsoft Visual Studio 10. 0\VC > tfsfieldmapping download /collection:http://W7-brunoc:8080/TFS/TPCĀ ”Ā /teamproject:A02 /mappingfile:”C:\mappingfile.xml “
THE syntax and the steps can be foundĀ here.
3. Edit the file we downloaded and add the mapping between the 2 fields that we are working.Ā In this case it is in line 20 where the mapping is defined.Ā An important detail is that the fields inĀ Microsoft Project, it is necessary to put the prefix “pjTask” before the name of the same.
1: <?xml version="1.0" encoding="utf-8"?>
2: <MSProject>
3: <Mappings>
4: <Mapping WorkItemTrackingFieldReferenceName="System.AreaPath" ProjectField="pjTaskOutlineCode9" />
5: <Mapping WorkItemTrackingFieldReferenceName="System.AssignedTo" ProjectField="pjTaskResourceNames" />
6: <Mapping WorkItemTrackingFieldReferenceName="System.Id" ProjectField="pjTaskText10" ProjectName="Work Item ID" />
7: <Mapping WorkItemTrackingFieldReferenceName="System.IterationPath" ProjectField="pjTaskOutlineCode10" />
8: <Mapping WorkItemTrackingFieldReferenceName="System.Reason" ProjectField="pjTaskText14" />
9: <Mapping WorkItemTrackingFieldReferenceName="System.Rev" ProjectField="pjTaskText23" />
10: <Mapping WorkItemTrackingFieldReferenceName="System.State" ProjectField="pjTaskText13" ProjectName="State" />
11: <Mapping WorkItemTrackingFieldReferenceName="System.Title" ProjectField="pjTaskName" />
12: <Mapping WorkItemTrackingFieldReferenceName="System.WorkItemType" ProjectField="pjTaskText24" />
13: <Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Common.Priority" ProjectField="pjTaskText19" ProjectName="Work Item Priority" />
14: <Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Common.StackRank" ProjectField="pjTaskNumber1" />
15: <Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Scheduling.CompletedWork" ProjectField="pjTaskActualWork" ProjectUnits="pjHour" IfSummaryRefreshOnly="true" />
16: <Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Scheduling.FinishDate" ProjectField="pjTaskFinish" PublishOnly="true" />
17: <Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Scheduling.OriginalEstimate" ProjectField="pjTaskBaselineWork" ProjectUnits="pjHour" IfSummaryRefreshOnly="true" />
18: <Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Scheduling.RemainingWork" ProjectField="pjTaskRemainingWork" ProjectUnits="pjHour" IfSummaryRefreshOnly="true" />
19: <Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Scheduling.StartDate" ProjectField="pjTaskStart" PublishOnly="true" />
20: <Mapping WorkItemTrackingFieldReferenceName="ElBruno.WbsCode" ProjectField="pjTaskWBS" PublishOnly="true" />
21: <LinksField ProjectField="pjTaskText26" />
22: <SyncField ProjectField="pjTaskText25" />
23: </Mappings>
24: </MSProject>
4. Now must climb this definition of mappings again our TFS server for this use the following command:
C:\Program Files (x 86) \Microsoft Visual Studio 10. 0\VC > tfsfieldmapping upload /collection:http://W7-brunoc:8080/TFS/TPCĀ ”Ā /teamproject:A02 /mappingfile:”C:\mappingfile.xml “
5 Done!
6. If now modify these tasks fromĀ Microsoft Project, as shown in the image below
When we sincronizemos them with TFS, we can already see theĀ Microsoft ProjectĀ WBS field in the “ElBruno.WbsCode” field of the Task.
Greetings @ Home
The Bruno

Ā Ā
Ā 
Leave a comment