It's all about the answers!

Ask a question

RTC Rest API: How to order results by specific value?


Diogo Braga (11) | asked Jul 17 '23, 7:05 a.m.

 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


permanent link
Ralph Schoon (63.2k33646) | answered Sep 12 '23, 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



permanent link
haseeb alam (91) | answered Jul 17 '23, 3:38 p.m.
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



Comments
Diogo Braga commented Jul 17 '23, 4:21 p.m.

Sorry, doesn't work. 


permanent link
haseeb alam (91) | answered Jul 20 '23, 10:02 a.m.
edited Jul 26 '23, 7:12 p.m.
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
Ralph Schoon commented Jul 27 '23, 2:31 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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?  


permanent link
Lowell Sanders (111) | answered Sep 12 '23, 4:13 a.m.
edited Sep 12 '23, 4:13 a.m.
Try This
https://example.com/ccm/rpt/repository/workitem?fields=workitem/workItem[projectArea/itemId='_Pxm-0HlGEeOR04eNUyuCuz'  pizza tower 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

It doesn't work. Can you recommend another one?

Comments
Ralph Schoon commented Sep 12 '23, 6:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.   

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.