It's all about the answers!

Ask a question

How can I read read all the workitems efficiently?


Gabi mordov (634) | asked Jun 08 '14, 6:49 a.m.
retagged Jun 09 '14, 11:52 a.m. by Martha (Ruby) Andrews (3.0k44251)
 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

Comments
Gabi mordov commented Jun 10 '14, 12:55 a.m.

 thanks allot.

have a nice day.
gabi

Accepted answer


permanent link
sam detweiler (12.5k6195201) | answered Jun 08 '14, 7:40 a.m.
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.
Ralph Schoon selected this answer as the correct answer

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.