Custom Attribute not correctly synching with CQ Connector
I am currently able to synchronize the "standard" set of fields for a custom work item I have built, including "Created By" and "Owned By" However, when I build out a new custom attribute for this work item, I receive the following data instead of the expected user name:
_KGRY4CFWEdq-WY5y7lROQw The process source code for this custom attribute is as follows: <customAttributes category="com.acn.team.workitem.workItemType.adtissue"> <customAttribute id="projectmgr" name="Project Manager" type="smallString"/> </customAttributes> |
5 answers
I am currently able to synchronize the "standard" set of fields for a custom work item I have built, including "Created By" and "Owned By" However, when I build out a new custom attribute for this work item, I receive the following data instead of the expected user name: We need a bit more information about the property mapping you set up. When you say "I receive the following data", does that mean that the ClearQuest field you've mapped to the custom attribute gets set to that value? Can you paste the XML for the property mapping into a response? Open your synchronization rule, go to the Source tab, find the propertyMapping element for the custom attribute mapping, copy the entire element (from the opening to the closing tag), and paste it into your response. By the way, the value you're seeing is a Jazz item identifier, which probably means that the property value is a reference to an object, not a string. John Jazz CQ Connector Team |
The custom attribute field mapped to the ClearQuest field is set to that value within RTC.
Synch Rule: <propertyMapping> <externalPropertyName>Adt_Project_Mgr_Name</externalPropertyName> <itemPropertyName>attribute:smallString:projectmgr</itemPropertyName> <incoming>true</incoming> <outgoing>false</outgoing> <itemIdentifier>false</itemIdentifier> <externalIdentifier>false</externalIdentifier> <externalModifier>false</externalModifier> <requiredItemProperties></requiredItemProperties> <requiredExternalProperties></requiredExternalProperties> <referenceSyncRule>ADT_Users</referenceSyncRule> </propertyMapping> Reference Synch Rule (ADT_Users): <xml> <syncRule> <name>ADT_Users</name> <externalTypeName>com.ibm.rational.clearquest.users</externalTypeName> <syncItemTypeName>Contributor</syncItemTypeName> <syncItemTypeNsURI>com.ibm.team.repository</syncItemTypeNsURI> <syncItemTypeQualifier></syncItemTypeQualifier> <itemManager>com.ibm.team.interop.service.managers.kernel.ContributorManager</itemManager> <externalManager>com.ibm.team.interop.service.managers.clearquest.CQExternalManagerForUser</externalManager> <maxCycleCount>0</maxCycleCount> <syncAllItemStates>false</syncAllItemStates> <propertyMappings> <propertyMapping> <externalPropertyName>fullname</externalPropertyName> <itemPropertyName>Name</itemPropertyName> <incoming>true</incoming> <outgoing>false</outgoing> <itemIdentifier>false</itemIdentifier> <externalIdentifier>false</externalIdentifier> <externalModifier>false</externalModifier> <requiredItemProperties></requiredItemProperties> <requiredExternalProperties></requiredExternalProperties> </propertyMapping> <propertyMapping> <externalPropertyName>login_name</externalPropertyName> <itemPropertyName>UserId</itemPropertyName> <incoming>true</incoming> <outgoing>false</outgoing> <itemIdentifier>true</itemIdentifier> <externalIdentifier>true</externalIdentifier> <externalModifier>false</externalModifier> <requiredItemProperties></requiredItemProperties> <requiredExternalProperties></requiredExternalProperties> </propertyMapping> </propertyMappings> </syncRule> |
So it seems that your CQ field, Adt_Project_Mgr_Name, is a reference to a CQ user record? If so, then you cannot map it to a custom attribute (unless you're happy with the way it's currently behaving). A reference-valued property must be mapped to a reference-valued property. Otherwise, you'll see what you're currently seeing: the actual "reference" value. A work item custom attribute cannot be a reference-valued property, so all it would do is show you what the value of the reference is.
John Jazz CQ Connector Team |
Has this limitation been documented in a Work Item?
|
Actually, I just realized that we do have a mechanism to do what you want (if I'm understanding it correctly). There is a special value transformer which can "indirect" through a reference and select a field of the referenced record. Here's what you need to do:
In your property mapping, change the external property name to "Adt_Project_Mgr_Name.login_name" (for example, assuming you want the "login_name" field of the user record to appear in the custom attribute; if you want a different field, specify it instead of "login_name"). Set the value transformer to one named "Connect Field to Custom Attribute Transformer". Continue to use your ADT_Users reference sync rule. The XML for the property mapping should end up looking like this: <propertyMapping> <externalPropertyName>Adt_Project_Mgr_Name.login_name</externalPropertyName> <itemPropertyName>attribute:smallString:projectmgr</itemPropertyName> <incoming>true</incoming> <outgoing>false</outgoing> <itemIdentifier>false</itemIdentifier> <externalIdentifier>false</externalIdentifier> <externalModifier>false</externalModifier> <requiredItemProperties></requiredItemProperties> <requiredExternalProperties></requiredExternalProperties> <transformExtension>com.ibm.team.interop.service.managers.workitem.ReferenceValueTransformer</transformExtension> <referenceSyncRule>ADT_Users</referenceSyncRule> </propertyMapping> John Jazz CQ Connector Team |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.