How can I read read all the workitems efficiently?
Hi all,
in order to read workitems i am using the following code:
IworkItem workitem = workitemClient.findWorkItemByid(i,IWorkItem.FULL_PROFILE,monitor)
but i am not happy with that.
i have many work items id , so i start it from the first id and run it till the Max Value.
it takes about 30 second.
what i want is to get the actual list of work items.
is that possible.
Thanks
Gabi
Accepted answer
you could use a query to get all workitems.. the query will get the workitem attributes too..
see my sample code here, the accepted answer.
https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes
this executes a predefined query and reports the attributes for each workitem.
one thing to be careful of, query's have a time limit set on the server, 5 minutes elapsed time default.
we had one task that took a couple hours to process all the workitems in a query and it kept timing out... get a workitem, process, repeat.
we fixed it by making a list of workitems (get them all), then process from the list.
the query extract part took 12 seconds. the process part still took 2 hours.
see my sample code here, the accepted answer.
https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes
this executes a predefined query and reports the attributes for each workitem.
one thing to be careful of, query's have a time limit set on the server, 5 minutes elapsed time default.
we had one task that took a couple hours to process all the workitems in a query and it kept timing out... get a workitem, process, repeat.
we fixed it by making a list of workitems (get them all), then process from the list.
the query extract part took 12 seconds. the process part still took 2 hours.
Comments
Gabi mordov
Jun 10 '14, 12:55 a.m.thanks allot.