How do I sort the results of a query using REST API?
Hello,
I have a very simple REST API query to retrieve all work items created within a time frame:
https://localhost:9443/ccm/rpt/repository/workitem?fields=workitem/workItem[creationDate>2014-07-14T00:00:00.00-0300 and creationDate<2014-07-20T23:59:59.99-0300]/(id|summary|creator/name)&size=100
The question is: is it possible to sort the results by any of the attributes? For example, I would like to sort the results by the creator name.
Thanks in advance.
I have a very simple REST API query to retrieve all work items created within a time frame:
https://localhost:9443/ccm/rpt/repository/workitem?fields=workitem/workItem[creationDate>2014-07-14T00:00:00.00-0300 and creationDate<2014-07-20T23:59:59.99-0300]/(id|summary|creator/name)&size=100
The question is: is it possible to sort the results by any of the attributes? For example, I would like to sort the results by the creator name.
Thanks in advance.
Accepted answer
You're using reportable REST API which does not mention sorting in its specification. Depending on your programming language, you can do the sorting on the resulting XML response once you get it.
If you don't have to use the reportable REST API, consider using the OSLC REST API (they are different). Below is a previous discussion on this topic.
https://jazz.net/forum/questions/157431/how-to-get-sorted-workitems-list-by-using-oslc
If you don't have to use the reportable REST API, consider using the OSLC REST API (they are different). Below is a previous discussion on this topic.
https://jazz.net/forum/questions/157431/how-to-get-sorted-workitems-list-by-using-oslc