It's all about the answers!

Ask a question

Work Item Template generating tasks in reverse order

Cameron McKay (571021) | asked Sep 11 '13, 11:53 a.m.

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

permanent link
Eric Jodet (6.3k5111120) | answered Sep 12 '13, 4:49 a.m.
 (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>
< rdf:resource="https://localhost:9443/jazz/resource/itemOid/"/>
< rdf:resource="#item2"/>
< rdf:resource="#item0"/>
  • 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
--> should work.

Hope it helps,
Cameron McKay selected this answer as the correct answer

One other answer

permanent link
Eric Jodet (6.3k5111120) | answered Sep 12 '13, 4:38 a.m.
 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

Your answer

Register or to post 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.