It's all about the answers!

Ask a question

Getting the TOTAL of work items based on a query via the REST API


Mike Shkolnik (9809161143) | asked Nov 19 '13, 8:53 p.m.
I know how to get work items from the API. For example:

https://SERVER:PORT/jazz/rpt/repository/workitem?fields=workitem/workItem[projectArea/name='ProjectName' and category/name='CategoryName']/(id|itemId|summary|target/name|category/name|type/name|owner/name)&size=500

Unfortunately, that does not return a TOTAL. You have to keep loading the "next" link until it returns no results - there is no way to know how far along you are in loading the query results. Is there a parameter I can pass that will show me the total # of work items I will get from the query above, for example?


One answer



permanent link
Don Weinand (7851) | answered Dec 02 '13, 10:58 p.m.
JAZZ DEVELOPER
From the URL it looks like you are using the Reportable REST API documented here:
https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI

I don't see anything in there documenting that the total is included in the response representation.  It doesn't mean it doesn't exist however.   I've pointed this forum post to the appropriate team responsible for the AP.  Perhaps they can clarify if what you are looking for exists or not.

There is also OSLC related workitems API.  You can see in the pagination section related here that it's including the total count you are looking for in the example representation.   Perhaps this is an alternative you could use instead.

https://jazz.net/wiki/bin/view/Main/WorkItemAPIsForOSLCCM20#Pagination

Comments
Mike Shkolnik commented Dec 03 '13, 2:37 p.m.

Thanks much - I do believe this will work, once I figure out the language. I see how to set the project, but I don't see how to set Filed Against to a specific category and Planned For to a specific iteration. I am not able to decipher that syntax from the examples.

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.