Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#134 XML export, attribute refId of relatedItem, wrong output

open
nobody
None
5
2009-11-20
2009-11-20
Russell E Glaue
No

Regarding jTrac 2.2.0-dev5
When relating items in an issue, and then exporting the issue as XML, the XML attribute 'refId' of element 'relatedItem' has wrong data. Note that the XML attribute 'refId' of element 'relatingItem' has correct data. So only the relatedItem element has wrong output.

I have identified the issue is that the wrong variable is written to the XML output for the 'refId' attribute of all 'relatedItem' elements.
The current Issue ID is written as the value of the relatedItem 'refId'.
Instead, the related Issue ID should be written as the value of the relatedItem 'refId'.

Let me provide the example. Here is a segment of the problem XML for a JTrac space named 'TEMPLATE':
<item refId="TEMPLATE-2">
<relatedItems>
<relatedItem refId="TEMPLATE-2" linkType="relatedTo"/>
<relatedItem refId="TEMPLATE-2" linkType="dependsOn"/>
</relatedItems>
<relatingItems>
<relatingItem refId="TEMPLATE-4" linkType="duplicateOf"/>
</relatingItems>
...
</item>

In issue TEMPLATE-2, it has these REAL relations:
1. TEMPLATE-4 is a duplicate of TEMPLATE-2
2. TEMPLATE-3 is depended on by TEMPLATE-2
3. TEMPLATE-1 is a relation of TEMPLATE-2

So the correct XML output should actually be:
<item refId="TEMPLATE-2">
<relatedItems>
<relatedItem refId="TEMPLATE-1" linkType="relatedTo"/>
<relatedItem refId="TEMPLATE-3" linkType="dependsOn"/>
</relatedItems>
<relatingItems>
<relatingItem refId="TEMPLATE-4" linkType="duplicateOf"/>
</relatingItems>
...
</item>

This is a bug. And probably easy to fix.
For further reference, I am attaching the entire export of all issues in the 'TEMPLATE' space.
Notice that all 'relatedItem' elements exhibit the results of the same bug. So this bug's cause and location in the code is easily identifiable.

Discussion

  • XML export of 'TEMPLATE' space issues.

     
    Attachments
  • wiliancb
    wiliancb
    2011-09-13

    See patch: 3408328.