TFS Integration Tools – Where does one start? … part 4 (Mapping users the easy way)
We continue from TFS Integration Tools – Where does one start? … part 1 (documentation), TFS Integration Tools – Where does one start? … part 2 (try a simple migration) and TFS Integration Tools – Where does one start? … part 3 (dust has settled …. did it work?).
In this post we will look at addressing one of the gremlins we encountered in TFS Integration Tools – Where does one start? … part 3 (dust has settled …. did it work?), by using field and value mapping to map users from the source (from) system to the target (to ) system.
To recap … what is the problem we are trying to solve?
On our source (from) system my credentials are known as Willy-Peter Schaub, but on the target these do not exist. For arguments sake, let us assume that we are migrating from a Team Project using domain credentials to a Team Project using LiveID. The migration moves the field values, including assigned to, “as is”, not knowing that the user is not valid on the target system.
How do we change the configuration?
We have the option of the translation service referred to in the previous post of this mini-series, or simply using the configuration and adding a field and value map as shown:
- <WITSessionCustomSetting>
- <Settings />
- <WorkItemTypes>
- <WorkItemType LeftWorkItemTypeName="Bug" RightWorkItemTypeName="Bug" fieldMap="GenericFieldMap" />
- <WorkItemType LeftWorkItemTypeName="Task" RightWorkItemTypeName="Task" fieldMap="GenericFieldMap" />
- <WorkItemType LeftWorkItemTypeName="Test Case" RightWorkItemTypeName="Test Case" fieldMap="GenericFieldMap" />
- <WorkItemType LeftWorkItemTypeName="Sprint" RightWorkItemTypeName="Sprint" fieldMap="GenericFieldMap" />
- <WorkItemType LeftWorkItemTypeName="Product Backlog Item" RightWorkItemTypeName="Product Backlog Item"
- fieldMap="GenericFieldMap" />
- </WorkItemTypes>
- <FieldMaps>
- <FieldMap name="GenericFieldMap">
- <MappedFields>
- <MappedField LeftName="*" RightName="*" MapFromSide="Left" valueMap="" />
- <MappedField LeftName="System.AssignedTo" RightName="System.AssignedTo" MapFromSide="Left" valueMap="UserMap" />
- </MappedFields>
- </FieldMap>
- </FieldMaps>
- <ValueMaps>
- <ValueMap name="UserMap">
- <Value LeftValue="Willy-Peter Schaub" RightValue="Willy@cave.co.za" />
- </ValueMap>
- </ValueMaps>
- </WITSessionCustomSetting>
In essence we define that:
- Lines 3-10: We want to process the Bug, Task, Test Case, Sprint and Product Backlog work item types, each referring to the GenericFieldMap.
- Lines 11-18: Each work item type must be mapped using the GenericFieldMap, which defines that all fields must be mapped as is *->*, except for the AssignedTo field.
- Lines 19-23: If the left value for the AssignedTo field is “Willy-Peter Schaub”, the value map defines a mapping to Willy@cave.co.za.
… the result is that the Assigned To field of the same WI is (1) mapped to the correct user when we re-run the migration against another team project, using (2) a different migration user.
Any new gremlins to be aware of?
Yes, the value mapping is currently case sensitive. See Why is my user value mapping only working partially? Q&A-54 for more information.
Hope these blogs posts have made a few cloudy features a bit clearer in your mind. Let me know what else we should explore in greater detail than we have in the range of TFS Integration Platform – Summary of Links posts.
Comments
Anonymous
July 29, 2012
I am struggling with mapping users from ClearQuest to TFS 2010 I have done as follows <MappedField LeftName="owner" RightName="System.AssignedTo" MapFromSide="Left" valueMap="UsersMap" /> BTW, i also tried with "Owner". <ValueMaps> <ValueMap name="UsersMap"> <Value LeftValue="mkramer" RightValue="947" /> </ValueMap> </ValueMaps> Can you help me out here?Anonymous
July 29, 2012
From your comment I am not sure what the actual run-time problem is, i.e. what are you struggling with? The configuration or is there a runtime migration issue? I recommend that you start by reviewing "Getting Started with IBM Rational to Team Foundation Server (TFS) Migrations" (blogs.msdn.com/.../getting-started-with-ibm-rational-to-team-foundation-server-tfs-migrations.aspx) and review the sample ClearQuest to TFS configuration samples that ship with the product. Here is an extract from one of the sample configuration files: <FieldMaps> ... <FieldMap name="Task2TaskFieldMap"> <MappedFields> <MappedField LeftName="Owner" RightName="System.AssignedTo" MapFromSide="Left" valueMap="UserMap"/> ... </MappedFields> <AggregatedFields> ... </AggregatedFields> </FieldMap> </FieldMaps> <ValueMaps> <ValueMap name="UserMap"> <!-- ## MAP USERS ## --> <Value LeftValue="michaf" RightValue="Michael Affronti (PM)" /> <Value LeftValue="aprist" RightValue="April Stewart (Dev Lead)" /> <Value LeftValue="dorikr" RightValue="Doris Krieger (Dev)" /> <Value LeftValue="abuobe" RightValue="Abu Obeida Bakhach (Dev)" /> <Value LeftValue="chriko" RightValue="Christine Koch (Tester)" /> <Value LeftValue="chriba" RightValue="Chris Barry (Business Stakeholder)" /> <Value LeftValue="robiwo" RightValue="Robin Wood (End User)" /> </ValueMap> Use the social.msdn.microsoft.com/.../threads forum to start a discussion thread if the above does not help.