How to fetch test cases from test plan using RQM REST API?
Hi all,
I have test plan which has some test cases I tried below URL to fetch the test cases but no test cases shown in the response, please suggest the solution:
https://<serverUrl>/com.ibm.rqm.integration.service.IIntegrationService/resources/<projectAlias>/testcase?fields=feed/entry/content/testcase/(*|testplan[@href='https://<serverUrl>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<projectAlias>/testplan?fields=feed/entry/content/testplan/urn:com.ibm.rqm:testplan:12'])
|
6 answers
Ian Barnard (2.2k●6●13)
| answered Nov 26 '21, 1:03 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Nov 29 '21, 4:55 a.m. AFAICT test plans are related directly to test cases, but not the reverse. Also, it's not possible to filter on the id but it is possible on the title, so for example for a test plan 'Development Test' this gets only the testcases for that test plan:
The result has an entry for each testcase like:
The filterable fields are documented https://jazz.net/wiki/bin/view/Main/RqmApi#SupportedFieldsResources in the third column of the table below the heading 'Supported Resources and Properties:' - scroll down to the testplan section.
If your project is configuration-managed see https://jazz.net/wiki/bin/view/Main/RqmApi#Notable_changes_from_ETM_5_0_to you'll have to add &oslc_config.context= and the URL-encoded configuration URI to the URL, so for example the complete URL before encoding might be:
(It's also possible to instead provide the configuration using a header Configuration-Context, see https://jazz.net/wiki/bin/view/Main/RqmApi#Notable_changes_from_ETM_5_0_to)
After URL encoding the configuration URL becomes the actual URL used:
Also please note this above is not an OSLC API, it is the reportable REST API. See https://jazz.net/wiki/bin/view/Main/RqmOslcQmV2Api
You may well be able to retrieve similar info using OSLC Query or through the OSLC APIs.
HTH
Ian
|
Can you try the following?
https://<server>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<projectAlias>/testcase?fields=feed/entry/content/testcase/(*|testplan/@href='https://<server>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<projectAlias>/testplan/urn:com.ibm.rqm:testplan:12'])
Comments
Andrew Ciaz
commented Dec 23 '20, 11:20 a.m.
@Subramanya Prasad Pilar Thanks for your response, but the above URL returns all the test cases from the project area. My test plan has only one test case
Subramanya Prasad Pilar
commented Dec 23 '20, 12:18 p.m.
The above URL should return only test cases belonging to testplan:12
Subramanya Prasad Pilar
commented Nov 28 '21, 1:10 a.m.
Note that now you must encode the entire parameter value when the project alias is a part of a URL parameter.
|
Hello @Andrew Ciaz,
By any chance, Did you got any solution for this thread, if yes , could you please share?
Thank you
Comments Hi,
This solution should work as suggested by Prasad.
Tried for test plan 8. It returned all test cases under that plan.
Make sure you use project alias not project name as is.
Get Project Alias
Hello @ Chandan M B
Thanks for quick response but looks like Andrew was correct , we are getting list of test cases which is not even linked with testplan , also i want to give you a short overview on how our RQM Project Structure looks like :
We have Project Area called Customer_QM and under that we different component created like electronics.HP , electronics.Havells etc with each component binded with stream , is it because of that this oslc api not working as excepted ?
Also if possible could you please provide me oslc api with the help of which i can retrieve test plan details like Summary,Test Cases,Test case execution record,..(refer attachment) in some format maybe json or something
Thank you
|
Hello @Ian Barnard,
Thanks for addressing my query,
May i know where exactly i need to add "&oslc_config.context= and the configuration URI to the URL" in this url
/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<Project Alias>/testplan?fields=feed/entry/content/testplan/[id=1]
Thanks
Comments
Ian Barnard
commented Nov 29 '21, 4:56 a.m.
| edited Nov 29 '21, 5:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Please don't add another answer when you want to comment on my answer, which I've updated. |
Hello all, I had the same issue in my project.
And I was able to find the reason and a solution for it.
It was caused by a bug in my RQM version 7.0.2 SR1
See Workarounds and Limitations: Known issues in IBM Engineering Test Management 7.0.2
Item "Inconsistent encoding and decoding for ETM Reportable REST API URLs with project aliases, external IDs, and query parameter values"
Despite the fact that it was already a service release, the bug from the original 7.0.2 release was still there.
My very first workaround was to take all the entries and filter them on my end using python.
It was not optimal, but it worked so at least I was able to proceed on other topics.
Solution: I had to escape the part of the url that starts after "fields=" section.
I used python: import urllib.parse And it took me at the end about four working days to find the real cause of the problem. I wasn't a big fan of the Jazz Platform (believe me, there are reasons for that). But now after this experience, please understand that I now hate it with all my heart! |
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.