Work Item Template generating tasks in reverse order
Hello,
I have created a work item template that contains several tasks. I want the tasks to appear in a specific order when a work item is created using the template. So, the output should appear as follows:
Work Item 1
- Task 1
- Task 2
- Task 3
- Task 4
However, the items are appearing in the reverse order. The output I am getting appears as follows:
Work Item 1
- Task 4
- Task 3
- Task 2
- Task 1
I have one explanation for why this is happening. I have a depends on relationship between all of my tasks. For example Task 2 depends on Task 1 and Task 2 depends on Task 3. So, the tasks are being created in the order in which they depend on each other. The order they are created seems to influence the order they are displayed.
Any help in this issue would be greatly appreciated.
Cheers, Cameron.
Accepted answer
(cont from my previous answer)
So I checked the template's XML source, and assume work items are created in the order they are found in the XML.
This is confirmed by looking at the code of the XMLTemplateParser which is responsible for parsing the template's XML.
In order for you to create your work items in a predictable way, you may edit your template's xml:
- open your Project Area
- go to links tab
- locate your template's XML
- "Save As" the template of your choice
- Edit the template and correct the order you would like
<rtc_cm:task rdf:ID="item1">
<dc:title>TASK 1</dc:title>
<rtc_cm:com.ibm.team.workitem.linktype.textualReference.textuallyReferenced rdf:resource="https://localhost:9443/jazz/resource/itemOid/com.ibm.team.workitem.WorkItem/_MRsz4BndEeOcQ_TkyOYt2g"/>
<rtc_cm:com.ibm.team.workitem.linktype.blocksworkitem.blocks rdf:resource="#item2"/>
<rtc_cm:com.ibm.team.workitem.linktype.parentworkitem.parent rdf:resource="#item0"/>
</rtc_cm:task>
- Save your change
- Back to the PA Editor, use "Replace " action to upload your new template
- save your changes
- create a new work item from template
Hope it helps,
Eric.
One other answer
Hello Cameron,
I gave it a try using RTC 4.0.3:
defect "PARENT" with child task TASK 1
Also created TASK 2 and TASK 3
TASK 2 depends on TASK 1 and TASK 3
Created a template from defect "PARENT" selecting all work items in the sub-tree.
Using the RTC Client or WebUI, I created a work item from template.
Upon creation, query result view shows
defect PARENT
TASK 1
TASK 2
TASK 3