Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes


Accepted answer

Permanent link

 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

0 votes


3 other answers

Permanent link
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


0 votes

Comments

Sorry, doesn't work. 


Permanent link
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

0 votes

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?  


Permanent link
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?

0 votes

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.   

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,936

Question asked: Jul 17 '23, 7:05 a.m.

Question was seen: 1,104 times

Last updated: Sep 12 '23, 6:10 a.m.

Confirmation Cancel Confirm