Why is filtering Test Case Results by the hosting Test Suite Result not working in RQM's REST API?
We are using RQM server 6.0.2. I need to use REST API to get all test case results that belong to a particular test suite result.
Test case result record ("executionresult") has a field "testsuitelog", which is test suite result. An attempt to filter by testsuitelog fails: the server returns all test case result records in the project, completely ignoring the filtering condition. However, if I use "testcase" as a filtering condition in a similar manner, then the filtering works correctly.
The xml for executionresult includes both testsuitelog and testcase.
Here is the [abbreviated] URL that I use with GET:
https://<server>...IIntegrationService/resources/<project>/executionresult?fields=feed/entry/content/executionresult/(*|testsuitelog[@href='<server>...IIntegrationService/resources/<project>testsuitelog/urn:com.ibm.rqm:testsuitelog:<id>']
The URL in @href was copied from one of the desired test case result's xml, so it is in the proper format.
That query returns all test case results. I can see in the xml how testsuitelog is different from what the query requested.
If I replace testsuitelog in the query with testcase, giving the proper URL in @href, things work as expected.
Can somebody shed the light on this discrepancy? Any suggestions how I can filter by testsuitelog will be greatly appreciated.
Accepted answer
The problem is that the executionresult/testsuitelog property is not supported for fitlering the executionresult feed (see https://jazz.net/wiki/bin/view/Main/RqmApi#FieldsSelectionNote). The REST API always responds to an invalid fields parameter by ignoring the fields parameter altogether which is why you are seeing the whole feed when you attempt to do this.
What you'll need to do is filter out the results you aren't interested in on the client side. That's not ideal, but it should work just fine. You might want to open an enhancement asking us to add support for it in a future release if it would make a significant difference to you (e.g. for performance).
Comments
Michael, thank you for your reply. Indeed, I missed the part of the API reference where it lists the fields that can be used for filtering. I assumed that any property could be used for filtering. Getting all results is not practical, especially given the limit on the feed entries in a single response; it will probably be faster to get the results one by one by the links in suite result record. I will consider adding the enhancement request.