[# TFS2010] HowTo: Add a new mapping between Microsoft Project and Team Foundation Server fields

image47dd1de4

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

image

When we sincronizemos them with TFS, we can already see the Microsoft Project WBS field in the “ElBruno.WbsCode” field of the Task.

image

 

Greetings @ Home

The Bruno

   

[#TFS2010] HowTo: Agregar un nuevo mapeo entre campos de Microsoft Project y Team Foundation Server

image47dd1de4

Buenas,

hoy un post tipo tutorial para mostrar como sincronizar un campo de Microsoft Project con un campo de una definición de un WorkItem de Team Foundation Server. Para este ejemplo he agregado un campo a la definición de una Task que se llama “ElBruno.WbsCode” (si no sabes como hacerlo este post te puede ayudar). La idea para este post es sincronizar el campo de Microsoft Project WBS con este nuevo campo de la Task.

Para esto seguiremos los siguientes pasos.

Tutorial

1. Abrir una consola de comandos de Visual Studio 2010.

2. Descargar el archivo de mapeo con un comando similar al siguiente:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>tfsfieldmapping download /collection:http://w7-brunoc:8080/tfs/tpc /teamproject:A02 /mappingfile:"C:\mappingfile.xml"

LA sintaxis y los pasos los puedes encontrar aquí.

3. Editar el archivo que hemos descargado y agregar el mapeo entre los 2 campos con los que estamos trabajando. En este caso es en la línea 20 en donde se define el mapeo. Un detalle importante es que para los campos de Microsoft Project, es necesario poner el prefijo “pjTask” antes del nombre del mismo.

   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. Ahora debemos subir esta definición de mapeos nuevamente a nuestro servidor TFS, para esto utilizamos el siguiente comando:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>tfsfieldmapping upload /collection:http://w7-brunoc:8080/tfs/tpc /teamproject:A02 /mappingfile:"C:\mappingfile.xml"

5. Done !!!

6. Si ahora modificamos estas tareas desde Microsoft Project, como muestra la siguiente imagen

image

cuando sincronizemos las mismas con TFS, ya podremos ver el campo de Microsoft Project WBS, en el campo “ElBruno.WbsCode” de la Task.

image

 

Saludos @ Home

El Bruno