Updating multiple work items
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.
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
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
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.
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.
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/
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/