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?
|
2 answers
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?
|
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. |
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.