It's all about the answers!

Ask a question

The REST API is running much slower than expected

Mike Shkolnik (9657160143) | asked Aug 16 '13, 1:28 p.m.
I wrote a little tool to query RTC through the REST API. Here is the syntax of the HTTP command being sent:

https://SERVER:PORT/jazz/rpt/repository/workitem?fields=workitem/workItem[projectArea/name='PROJECTNAME' and category/name='CATEGORYNAME' and target/name='ITERATIONNAME']/(id|itemId|summary|target/name|category/name|projectArea/name|modified|modifiedBy/name|type/name|owner/name|duration|timeSpent|state/(name|group)|itemHistory/(summary|target/name|category/name|projectArea/name|modified|modifiedBy/name|type/name|owner/name|duration|timeSpent|state/(name|group)|description))&size=999

I also tried substituting the name fields for itemId fields, for example:

[projectArea/itemId='_weudbrw83452934' and category/itemId='_78rehrgh8ddfhske' and target/itemId='_i345h3ih53i4']                        (made up numbers for this example)

If anything, that took longer.

The query takes about 45 seconds to run. Of course if I pull up a query through the web client directly instead of using the API, it comes up in 2 seconds. Is there some other way of doing queries through the API that is faster? Perhaps using the OSLC syntax?

One answer

permanent link
Mike Shkolnik (9657160143) | answered Aug 21 '13, 7:35 p.m.
I found a faster way to do work item queries via OSLC:

https://SERVER:PORT/jazz/oslc/contexts/_IIGX4ImSEeGfRoNJQk-wkQ/workitems?oslc_cm.pageSize=100&oslc_cm.query=rtc_cm:plannedFor="_ZypC8IX5EeKO39ytcjC0xQ" and rtc_cm:filedAgainst="_nR9kIImYEeGfRoNJQk-wkQ"

HOWEVER... that query does not get me history data and the whole point of creating this tool was to get easy access to history data. So... is there a way to get history data via OSLC (without having to query each Work Item separately)?

Note: The OSLC method needs to be paginated. If you set page size much higher than 100 you get "query expired" errors. Still takes a lot less time to run than the method in the original post.

Your answer

Register or to post your answer.