It's all about the answers!

Ask a question

Updating multiple work items


0
1
Sarthak Sharma (4711520) | asked Aug 27 '12, 4:16 a.m.
edited Aug 27 '12, 4:34 a.m. by Ralph Schoon (61.2k33643)
If I have list of two or more workitems and I want to perform Save operation on all of them.
It is something like I have to set values from parent attribute to the same attribute in children.
How Can it be done ?

If I save 1 work item in the list then other work items in the list are lost as run() method is called again.

Please suggest something.
Thanks in advance.

2 answers



permanent link
Aradhya K (1.4k44345) | answered Aug 28 '12, 7:08 a.m.
JAZZ DEVELOPER
Hi Sarthak
Do you have a adviser or participant which will update the parent work item on save of the child work item??
In that case if you try to save both parent and child then the parent save fail with stale data Exception.
You need to save all the children first then load the parent and update it and save.


Comments
Sarthak Sharma commented Aug 30 '12, 2:42 a.m.

I am doing it using participant and I am traversing all the children work items and then I am trying to save them using saveWorkItem2() method. But is going through only 1 work item repeatedly.


Sarthak Sharma commented Aug 30 '12, 2:43 a.m.

Basic requirement is to traverse up to the root work item(in the tree) and then saving all the children workitems according to some condition.


permanent link
Ralph Schoon (61.2k33643) | answered Aug 27 '12, 4:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Sarthak,

I am not sure which run() method you refer to.

Dependent of the context you will have to run several save or modify operation.

On the server you can use saveWorkitem2() or saveWorkitem3() as used in https://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/

Using the client API you can use the same WorkItemOperation used in save https://rsjazz.wordpress.com/2012/08/02/subscribing-to-a-work-item-using-the-java-api/

Your answer


Register or to post your answer.