CQ Connector: Mapping a CQ field to the RTC Resolution
I am seeing an odd behavior in CQ record to RTC syncronization through the CQ Connector.
I have created a custom workitem in RTC that has a very simple workflow with only 2 states, Opened and Closed. Each of my CQ states maps to one or the other. For example, in CQ I have a state called Canceled which maps to RTC Closed. In CQ, when the Canceled state is chosen, the user must choose a value in the Answer field. In my sync rule, I have a mapping of CQ State to RTC Status, and CQ Answer to RTC Resolution. I have noticed that when a CQ record is updated such that: 1. The changes to the CQ State cause the RTC State to change from Opened to Closed, and 2. An attempt is made to map the Answer value to a Resolution value The state changes ok, but the Resolution mapping doesn't work properly. For example, one of the Answer values is as_designed, and my sync rule maps that to the "Won't Fix" Resolution. But when I Cancel a defect, and set the Answer to as_designed, in RTC, after the sync, the work item is Closed, but he Answer says Fixed. I noticed that if I changed my mapping so that the Canceled CQ state doesn't map to Closed in RTC, which is to say that Canceling my CQ defect doesn't cause a state change in RTC, then the Answer to Resolution mapping works properly. Is it possible that under the covers when the connector run the required action to move the RTC record from Opened to Closed, that the act of changing the state somehow triggers an automatic setting of Resolution that is overriding the mapping coming in from the CQ Answer field? Here is my workflow definition:
|
15 answers
Please include a copy of your sync rule so we can investigate this further.
|
Here is the exported xml for my sync rule:
<?xml version="1.0" encoding="utf-8"?> |
I noticed in the sync rule that there is a CQ classification field that is mapped to the work item type field and that there are 3 different work item types. Do all the work item types have the same work flow?
|
Yes, all three of the IMCS_* work items use the same workflow.
|
Please turn on logging in the jazz server so we can see what values are being synced in. Modify the log4j.properties file in the JazzTeamServer-install-directory\server directory by adding the following entry:
log4j.logger.com.ibm.team.interop=DEBUG Then you'll need to restart the jazz server and CQ gateway. |
Also what version of the CQ Connector are you using?
|
Beta 2.
C:\Program Files\Rational\JAZZ CQ Connectors 2 Beta 2\jazz\connectors\gateway>cat buildId.txt I20090520-1148 |
I gave you the old directory for the jazz server log4j.properties file. It's now in /jazz/server/conf/jazz directory.
After you restart the jazz server and cq gateway, create a cq defect. Sync it into a jazz work item. Then transition your cq defect, set the answer field, and let that sync. Then look into the jazz.log file in the /jazz/server/logs directory. You're looking for an entry that says "Attempting incoming sync...". Somewhere after that, you should see "Applying properties to Jazz item:", then a list of the jazz properties that will be set and it's values. You should see something like this " {attribute:smallString:cq_state_attr=Resolved, State=Resolved, Resolution=Won't Fix}". Send that section of the log file to us. |
Well, the trace provided some interesting information. I didn't notice the first time when I tried this, but when I started from scratch with a new cq defect, I noticed that I needed to do the following steps to make the error occur.
1. Create the defect in ClearQuest. Allow it to sync to RTC. CQ State = Opened, CQ Answer = "". RTC State = Opened, RTC Resolution = "". 2. Return the defect in CQ. Allow it to sync to RTC. CQ State = Returned, CQ Answer = "as_designed: ...". RTC State = Closed, RTC Resolution = "Won't Fix". (this is correct). Here is the information from the trace for that update: : Attempting incoming sync; running as chrisr@ca.ibm.com 2009-06-12 12:19:36,344 DEBUG com.ibm.team.interop - ExternalProxy : Syncing in external state _92YxAFeFEd6uiLVW5f4NNQ 2009-06-12 12:19:36,344 DEBUG com.ibm.team.interop - ExternalProxy : Base external state id: _aeSVnldyEd6FGffBDT-oIw 2009-06-12 12:19:37,813 DEBUG com.ibm.team.interop - ExternalProxy : Last synced item state id: _JZAPoFdyEd6FGffBDT-oIw 2009-06-12 12:19:37,860 DEBUG com.ibm.team.interop - ExternalProxy : Applying properties to Jazz item: {State=Closed, attribute:IMCS_States:cq_imcs_state=Returned, Resolution=Won't Fix} 3. Reopen the defect in ClearQuest. Allow it to sync to RTC. CQ State = Opened, CQ Answer = "". RTC State = Opened, RTC Resolution = "" (?). Not sure what the Resolution is changed to when the Answer field is blanked out. UUID _6lc7wVdxEd6FGffBDT-oIw]: Attempting incoming sync; running as chrisr@ca.ibm.com 2009-06-12 12:20:40,875 DEBUG com.ibm.team.interop - ExternalProxy : Syncing in external state _HfSk8FeGEd6uiLVW5f4NNQ 2009-06-12 12:20:40,875 DEBUG com.ibm.team.interop - ExternalProxy : Base external state id: _92YxAFeFEd6uiLVW5f4NNQ 2009-06-12 12:20:40,984 DEBUG com.ibm.team.interop - ExternalProxy : Last synced item state id: __LxPgFeFEd6uiLVW5f4NNQ 2009-06-12 12:20:41,000 DEBUG com.ibm.team.interop - ExternalProxy : Applying properties to Jazz item: {State=Opened, attribute:IMCS_States:cq_imcs_state=Opened} I note that from the debug, it doesn't show the Resolution being set to anything. Not sure if that is related to the issue. 4. Return the defect in ClearQuest again. Allow it to sync to RTC. CQ State = Returned, CQ Answer = "as_designed: ...". RTC State = Closed, RTC Resolution should be "Won't Fix", but is getting set to "Fixed". Here is the debug: : Attempting incoming sync; running as chrisr@ca.ibm.com 2009-06-12 12:21:45,296 DEBUG com.ibm.team.interop - ExternalProxy : Syncing in external state _RFzMMFeGEd6uiLVW5f4NNQ 2009-06-12 12:21:45,296 DEBUG com.ibm.team.interop - ExternalProxy : Base external state id: _HfSk8FeGEd6uiLVW5f4NNQ 2009-06-12 12:21:45,389 DEBUG com.ibm.team.interop - ExternalProxy : Last synced item state id: _Hi3dUFeGEd6uiLVW5f4NNQ 2009-06-12 12:21:45,405 DEBUG com.ibm.team.interop - ExternalProxy : Applying properties to Jazz item: {State=Closed, attribute:IMCS_States:cq_imcs_state=Returned} I notice that Resolution isn't being set to anything explicitly. Is the problem that the connectors aren't picking up the change to the Answer field on the CQ side? Thanks, Chris |
Yes, I agree the log provides some interesting information.
Try the following: 1. Add the Unresolved resolution to your workflow's list of resolutions. <resolution icon="processattachment:/workflow/unresolve.gif" id="r0" name="Unresolved"/>. Don't know yet if the id matters, but for now just copy this as is. 2. Don't add this resolution to any action's list of resolutions. 3. Modify the sync rule by adding the value mapping that maps the Unresolved resolution value to the CQ blank answer value: <valueMapping> <externalValue></externalValue> <itemValue>Unresolved</itemValue> <defaultExternalValue>false</defaultExternalValue> <defaultItemValue>false</defaultItemValue> </valueMapping> Remove the value mapping you had previously mapped to the blank answer value: <valueMapping> <externalValue/> <itemValue>To Be Determined</itemValue> <defaultExternalValue>false</defaultExternalValue> <defaultItemValue>false</defaultItemValue> </valueMapping> |
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.