It's all about the answers!

Ask a question

How to fetch test cases from test plan using RQM REST API?

Andrew Ciaz (5938) | asked Dec 23 '20, 8:29 a.m.

 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:


4 answers

permanent link
Ian Barnard (1.7k613) | answered Nov 26 '21, 1:03 p.m.
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:

https://SERVER:PORT/qm/service/<Project Alias>/testplan?fields=feed/entry/content/testplan[title='Development Test']/testcase
The result has an entry for each testcase like:
The filterable fields are documented 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 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:
  • https://SERVER:PORT/qm/service/<Project Alias>/testplan?fields=feed/entry/content/testplan[title='Development Test']/&oslc_config.context=https://SERVER:PORT/qm/oslc_config/resources/
(It's also possible to instead provide the configuration using a header Configuration-Context, see

After URL encoding the configuration URL becomes the actual URL used:
  • https://SERVER:PORT/qm/service/<Project Alias>/testplan?fields=feed/entry/content/testplan[title='Development Test']/&

Also please note this above is not an OSLC API, it is the reportable REST API. See

You may well be able to retrieve similar info using OSLC Query or through the OSLC APIs.


permanent link
Subramanya Prasad Pilar (4.6k14) | answered Dec 23 '20, 9:25 a.m.
Can you try the following?

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.

permanent link
Rajat Krishnan (709) | answered Nov 26 '21, 6:19 a.m.
Hello @Andrew Ciaz,
By any chance, Did you got any solution for this thread, if yes , could you please share?
Thank you

Chandan M B commented Nov 26 '21, 9:39 a.m. | edited Nov 26 '21, 9:39 a.m.

Rajat Krishnan commented Nov 26 '21, 11:54 a.m. | edited Nov 26 '21, 11:59 a.m.
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

Test Plan Section

permanent link
Rajat Krishnan (709) | answered Nov 27 '21, 8:17 a.m.
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/<Project Alias>/testplan?fields=feed/entry/content/testplan/[id=1]


Ian Barnard commented Nov 29 '21, 4:56 a.m. | edited Nov 29 '21, 5:56 a.m.

Please don't add another answer when you want to comment on my answer, which I've updated. 

Your answer

Register or to post your answer.