how to sort the result of an XML based on the value to any tag in OSLC & REST API?
2 answers
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.
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.