Share via


TFS Integration Tools – Why are my field mappings only working one way? Q&A-41

We recently noticed a support thread that was discussing a synchronization issue between ClearQuest and TFS. While the field mappings as defined in the session configuration worked like a charm from ClearQuest to TFS, they did not appear to take effect for the reverse journey from TFS to ClearQuest (CQ).

Here is a hypothetical example configuration file extract, showing the field and value maps for the CQ Defect and the TFS Bug:

    1: <SettingXml>
    2:   <WITSessionCustomSetting>
    3:             <WorkItemTypes>
    4:               <WorkItemType LeftWorkItemTypeName="Defect" RightWorkItemTypeName="Bug" fieldMap="Defect2BugFieldMap" />
    5:             </WorkItemTypes>
    6:             <FieldMaps>
    7:               <FieldMap name="Defect2BugFieldMap">
    8:                 <MappedFields>
    9:                   <MappedField LeftName="Headline" RightName="System.Title" MapFromSide="Left" valueMap="" />
   10:                   <MappedField LeftName="State" RightName="System.State" MapFromSide="Left" valueMap="StateMapCQ2TFS" />
   11:                   <MappedField LeftName="Description" RightName="System.Description" MapFromSide="Left" valueMap="" />
   12:                   <MappedField LeftName="history" RightName="System.History" MapFromSide="Left" valueMap="" />
   13:                   <MappedField LeftName="Owner" RightName="System.AssignedTo" MapFromSide="Left" valueMap="UsersMap" />
   14:                   <MappedField LeftName="Priority" RightName="Microsoft.VSTS.Common.Priority" MapFromSide="Left" valueMap="PriorityMapCQ2TFS" />
   15:                   <MappedField LeftName="Severity" RightName="Microsoft.VSTS.Common.Severity" MapFromSide="Left" valueMap="SeverityMap" />
   16:                 </MappedFields>
   17:               </FieldMap>
   18:             </FieldMaps>
   19:             <ValueMaps>          
   20:               <ValueMap name="StateMapCQ2TFS">
   21:                 <Value RightValue="Active" LeftValue="Assigned" />
   22:                 <Value RightValue="Active" LeftValue="Duplicate" />
   23:                 <Value RightValue="Active" LeftValue="Opened" />
   24:                 <Value RightValue="Active" LeftValue="Submitted" />
   25:                 <Value RightValue="Resolved" LeftValue="Postponed" />
   26:                 <Value RightValue="Resolved" LeftValue="Resolved" />
   27:                 <Value RightValue="Closed" LeftValue="Closed" />
   28:               </ValueMap>
   29:          <ValueMap name="PriorityMapCQ2TFS">
   30:                 <Value LeftValue="1-Resolve Immediately" RightValue="1" />
   31:                 <Value LeftValue="2-Give High Attention" RightValue="2" />
   32:                 <Value LeftValue="3-Normal Queue" RightValue="3" />
   33:                 <Value LeftValue="4-Low Priority" RightValue="3" />
   34:               </ValueMap>
   35:               <ValueMap name="SeverityMap">
   36:                 <Value LeftValue="1-Critical" RightValue="1 - Critical" />
   37:                 <Value LeftValue="2-Major" RightValue="2 - High" />
   38:                 <Value LeftValue="3-Average" RightValue="3 - Medium" />
   39:                 <Value LeftValue="4-Minor" RightValue="4 - Low" /> 
   40:               </ValueMap>                
   41:               <ValueMap name="UsersMap">
   42:                 <Value LeftValue="xyz" RightValue="abc" />
   43:                 <Value LeftValue="xyz" RightValue="Administrator" />                  
   44:               </ValueMap>            
   45:             </ValueMaps>
   46:           </WITSessionCustomSetting>
   47: </SettingXml>
   48: <SettingXmlSchema />

The configuration looks and is correct … hmmmmm, then what’s the problem?

<----------- SYNC ------------->

Looking at the mappings in the extract above, we notice that we have a MapFromSide=”Left” , which in this hypothetical scenario means from CQ (left) to TFS (right).

There are no mappings defined in the configuration for the TFS to CQ direction. To define the reverse (right –> left) mapping, you need to define Mappings in the TFS to CQ direction by having entries with MapFromSide=”Right” .

Here is a revised hypothetical configuration extract, with the Mappings for both directions defined:

    1: <SettingXml>
    2:   <WITSessionCustomSetting>
    3:             <WorkItemTypes>
    4:               <WorkItemType LeftWorkItemTypeName="Defect" RightWorkItemTypeName="Bug" fieldMap="Defect2BugFieldMap" />
    5:             </WorkItemTypes>
    6:             <FieldMaps>
    7:               <FieldMap name="Defect2BugFieldMap">
    8:                 <MappedFields>
    9:                   <MappedField LeftName="Headline" RightName="System.Title" MapFromSide="Left" valueMap="" />
   10:                   <MappedField LeftName="Headline" RightName="System.Title" MapFromSide="Right" valueMap="" />
   11:                   <MappedField LeftName="State" RightName="System.State" MapFromSide="Left" valueMap="StateMapCQ2TFS" />
   12:                   <MappedField LeftName="State" RightName="System.State" MapFromSide="Right" valueMap="StateMapTFS2CQ" />
   13:                   <MappedField LeftName="Description" RightName="System.Description" MapFromSide="Left" valueMap="" />
   14:                   <MappedField LeftName="Description" RightName="System.Description" MapFromSide="Right" valueMap="" />
   15:                   <MappedField LeftName="history" RightName="System.History" MapFromSide="Left" valueMap="" />
   16:                   <MappedField LeftName="history" RightName="System.History" MapFromSide="Right" valueMap="" />
   17:                   <MappedField LeftName="Owner" RightName="System.AssignedTo" MapFromSide="Left" valueMap="UsersMap" />
   18:                   <MappedField LeftName="Owner" RightName="System.AssignedTo" MapFromSide="Right" valueMap="UsersMap" />
   19:                   <MappedField LeftName="Priority" RightName="Microsoft.VSTS.Common.Priority" MapFromSide="Left" valueMap="PriorityMapCQ2TFS" />
   20:                   <MappedField LeftName="Priority" RightName="Microsoft.VSTS.Common.Priority" MapFromSide="Right" valueMap="PriorityMapTFS2CQ" />    
   21:                   <MappedField LeftName="Severity" RightName="Microsoft.VSTS.Common.Severity" MapFromSide="Left" valueMap="SeverityMap" />
   22:                   <MappedField LeftName="Severity" RightName="Microsoft.VSTS.Common.Severity" MapFromSide="Right" valueMap="SeverityMap" />                        
   23:                 </MappedFields>
   24:               </FieldMap>
   25:             </FieldMaps>
   26:             <ValueMaps>          
   27:               <ValueMap name="StateMapCQ2TFS">
   28:                 <Value RightValue="Active" LeftValue="Assigned" />
   29:                 <Value RightValue="Active" LeftValue="Duplicate" />
   30:                 <Value RightValue="Active" LeftValue="Opened" />
   31:                 <Value RightValue="Active" LeftValue="Submitted" />
   32:                 <Value RightValue="Resolved" LeftValue="Postponed" />
   33:                 <Value RightValue="Resolved" LeftValue="Resolved" />
   34:                 <Value RightValue="Closed" LeftValue="Closed" />
   35:               </ValueMap>
   36:               <ValueMap name="StateMapTFS2CQ">
   37:                 <Value RightValue="Active" LeftValue="Assigned" />
   38:                 <Value RightValue="Resolved" LeftValue="Resolved" />
   39:                 <Value RightValue="Closed" LeftValue="Closed" />
   40:               </ValueMap>                
   41:               <ValueMap name="PriorityMapCQ2TFS">
   42:                 <Value LeftValue="1-Resolve Immediately" RightValue="1" />
   43:                 <Value LeftValue="2-Give High Attention" RightValue="2" />
   44:                 <Value LeftValue="3-Normal Queue" RightValue="3" />
   45:                 <Value LeftValue="4-Low Priority" RightValue="3" />
   46:               </ValueMap>
   47:               <ValueMap name="PriorityMapTFS2CQ">
   48:                 <Value LeftValue="1-Resolve Immediately" RightValue="1" />
   49:                 <Value LeftValue="2-Give High Attention" RightValue="2" />
   50:                 <Value LeftValue="3-Normal Queue" RightValue="3" />
   51:               </ValueMap>
   52:               <ValueMap name="SeverityMap">
   53:                 <Value LeftValue="1-Critical" RightValue="1 - Critical" />
   54:                 <Value LeftValue="2-Major" RightValue="2 - High" />
   55:                 <Value LeftValue="3-Average" RightValue="3 - Medium" />
   56:                 <Value LeftValue="4-Minor" RightValue="4 - Low" /> 
   57:               </ValueMap>                
   58:               <ValueMap name="UsersMap">
   59:                 <Value LeftValue="xyz" RightValue="abc" />
   60:                 <Value LeftValue="xyz" RightValue="Administrator" />                  
   61:               </ValueMap>            
   62:             </ValueMaps>
   63:           </WITSessionCustomSetting>
   64: </SettingXml>
   65: <SettingXmlSchema />

Special thanks to Bill, who created the configuration file as part of his testing and allowed me to do the productive copy+paste for this blog post :)

Questions? If yes, add comment.