RTC Rest API: How to order results by specific value?
![]() How can I set an order by a specific value of the workitems results when make an RTC API request?
Here my curretly URL:
https://example.com/ccm/rpt/repository/workitem?fields=workitem/workItem[projectArea/itemId='_Pxm-0HlGEeOR04eNUyuCuz' and type/id='incident' and creationDate > 2023-07-10T00:00:00.0-0300]/(id|state/(id|name)|summary|owner/name|creationDate|resolutionDate|dueDate|allExtensions/(key|displayValue))&size=5000&pos=5000
|
Accepted answer
![]()
Ralph Schoon (62.3k●3●36●43)
| answered Sep 12, 6:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER I consider this unsupported. See the comment:
This is the documentation: https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI
I can not find any indication that there is a sort operator. That does not mean, there is none, but it is undocumented. There is especially no keyword "sort". The appending of the sort keyword is completely undocumented. I found this answer which matches my thoughts: https://jazz.net/forum/questions/158958/how-do-i-sort-the-results-of-a-query-using-rest-api
I think it is not supported. In addition I consider the answers of this user to be random, not fact based. Why one would do that, I don't know.
To sort, you would have to postprocess the data on your own criteria. Ralph Schoon selected this answer as the correct answer
|
3 other answers
![]()
Try This
https://example.com/ccm/rpt/repository/workitem?fields=workitem/workItem[projectArea/itemId='_Pxm-0HlGEeOR04eNUyuCuz' and type/id='incident' and creationDate > 2023-07-10T00:00:00.0-0300]/(id|state/(id|name)|summary|owner/name|creationDate|resolutionDate|dueDate|allExtensions/(key|displayValue))&size=5000&pos=5000&sort=field_name
|
![]()
Oh can you try this format.
https://example.com/ccm/rpt/repository/workitem?fields=workitem/workItem[projectArea/itemId='_Pxm-0HlGEeOR04eNUyuCuz' and type/id='incident' and creationDate > 2023-07-10T00:00:00.0-0300]/(id|state/(id|name)|summary|owner/name|creationDate|resolutionDate|dueDate|allExtensions/(key|displayValue))&size=5000&pos=5000&sort=creationDate,desc
Comments What is the basis for this answer? I looked into the documentation https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI#Reportable_REST_API and there is no mentioning of a sort option. Where do you get your knowledge? |
![]() Try This
It doesn't work. Can you recommend another one?
Comments This is the documentation: https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI
I can not find any indication that there is a sort operator. That does not mean, there is none, but it is undocumented. There is especially no keyword "sort". The appending of the sort keyword is completely undocumented. I found this answer which matches my thoughts: https://jazz.net/forum/questions/158958/how-do-i-sort-the-results-of-a-query-using-rest-api
I think it is not supported. In addition I consider the answers of this user to be random, not fact based. Why one would do that, I don't know.
To sort, you would have to postprocess the data on your own criteria. |