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

how to sort the result of an XML based on the value to any tag in OSLC & REST API?

 how to sort the result of an XML based on the value to any tag like oslc:Modified or oslc:shortId
using OSLC or REST API queries?

0 votes



2 answers

Permanent link

Hi Rishi,

I did that using a java client, and I did through sorting algorithm that you can find easily but it depends how you are consuming the web services, as far I know I haven see a function on the api for that? I'm curious too?

0 votes


Permanent link
Since you tagged this question with both RTC and RQM, I assume that you are interested in both tools.

If you want to use the OSLC sort feature, it has to be implemented in the tools to begin with. So it may work, or may work on some attributes, or may not work at all.

For RTC, contrary to the document, I have not found a reliable way to sort any of the attributes of a work item (with RTC 5.0.2). The "oslc.orderBy" parameter has no effect without the "OSLC-Core-Version: 2.0" header and gives out an error with the header.
https://jazz.net/wiki/bin/view/Main/WorkItemAPIsForOSLCCM20

For RQM, you can try the "sort" parameter which should sort the artifacts on modified date. It appears that modified date is the only attribute supports sorting though. So "shortId" is out.
https://jazz.net/wiki/bin/view/Main/RqmApi#sort

All in all, I think you will have to do the same thing as Rafael mentioned and sort the items _after_ retrieving the items from the OSLC/REST call.

0 votes

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

Question asked: Jun 30 '15, 2:14 p.m.

Question was seen: 2,474 times

Last updated: Jun 30 '15, 9:02 p.m.

Confirmation Cancel Confirm