It's all about the answers!

Ask a question

RQM API: Test Cases not being filtered by Test Suite ID


Michael Mark (262) | asked Aug 30 '23, 2:13 p.m.
edited Aug 30 '23, 2:15 p.m.

 Hi,


I am trying to filter Test Cases with the Test Suite ID#. I believe the API isn't handling my filter well, so I am not sure what is going on. Instead of just showing the test cases that are connected to the specific test suite, the API is showing ALL of the test cases in the whole project area.  Here is the link I am trying to utilize to call the API:

https://<projecturl:port>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<Project+Area>/testcase?fields=feed/entry/content/testcase/(*|testsuite[@href='https://<projecturl:port>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<Project+Area>/testsuite/urn:com.ibm.rqm:testsuite:<testsuiteid>'])

Is there an issue with my syntax perhaps? Any help would be great.

Accepted answer


permanent link
Michael Mark (262) | answered Jan 15, 12:39 p.m.

 Posting an answer to my own question in case anyone needs it:


==================================================================
RQM Reportable Rest API allows filtering via the [] brackets. However, when RQM moved to ETM version 7.0.2, the fields were modified so that they are required to be UTF-8 URL Encoded. The previously accepted URL for the API call would be as follows:

https:/<projecturl:port>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<Project+Area>/executionworkitem?fields=feed/entry/content/executionworkitem/(|testplan[@href='https://<projecturl:port>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<Project+Area>/testplan/urn:com.ibm.rqm:testplan:491'])

The URL encoding would need to be done to the last part after the 'fields=' part in order to successfully filter. Specifically what broke this call was the unacceptable 2nd '+' character. It is therefore a good idea to encode the rest of the URL to ensure that we do not run into any issues in the future.

Example of accepted API calls as of 7.0.2:

List all of the Execution Work Items (execution records) that are filtered by Test Plan ID #491:

https://<projecturl:port>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<Project+Area>/executionworkitem?fields=feed%2Fentry%2Fcontent%2Fexecutionworkitem%2F(%7Ctestplan%5B%40href%3D%27https%3A%2F%2F<projecturl:port>%2Fqm%2Fservice%2Fcom.ibm.rqm.integration.service.IIntegrationService%2Fresources%2F<Project+Area>%2Ftestplan%2Furn%3Acom.ibm.rqm%3Atestplan%3A491%27%5D)

..is the UTF-8 URL Encoded version of:
https://<projecturl:port>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<Project+Area>/executionworkitem?fields=feed/entry/content/executionworkitem/(*|testplan[@href='https://<projecturl:port>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<Project+Area>/testplan/urn:com.ibm.rqm:testplan:491'])

As you can see, the encoding begins after the '=' character. 
==================================================================

I wrote this small explanation myself after solving this issue for my own application. If anyone else runs into this issue, I am happy to help.

Ralph Schoon selected this answer as the correct answer

Your answer


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