How can we find the Testplan name of the currently executing test script ? USING RQM REST API
Accepted answer
https://jazz.net/products/rational-quality-manager/api-doc-4.0.4/schemas/qm_xsd/elements/executionworkitem.html#a35
However, you have to know the ID of the TCER (or executionworkitem).
Comments
Hi Paul,
At the time of submission of a test case, we cant find TCER Id ..and TCER name can be duplicate so is it impossible to get testplan name with information we have at the time of submission of a Testcase?
Thanks,
Best Regards,
Dev Kashyap.
The test case can be associated to one or more test plans. You can find the test plan(s) associated to a test case by using the fields filtering (see https://jazz.net/wiki/bin/view/Main/RqmApi#FieldsExamples):
<feedUrl>?fields=feed/entry/content/testplan/(*|testcase[@href=' <resourceUrl>'])
Yeah , i tried this approach also .. and its working fine . but it can return multiple testplans as at the time of execution a test case associate with only one test plan. and my requirement is to get only that testplan.
Please correct me if i am wrong.
Thanks,
Dev
The only way to determine the test plan at the time of execution is to resolve the test plan associated with the TCER.
1 vote
Hi Paul,
"resolve the test plan associated with the TCER" is it mean to get all the TestPlan associate with a testcase using
<feedUrl>?fields=feed/entry/content/testplan/(*|testcase[@href=' <resourceUrl>'])
and then filter the results according to the TCER name ?
Thanks,
Dev
No, the TCER (or executionworkitem) contains the reference to the test plan:
https://jazz.net/products/rational-quality-manager/api-doc-4.0.4/schemas/qm_xsd/elements/executionworkitem.html#a35
However, you have to know the ID of the TCER (or executionworkitem).
3 other answers
There is no direct association between test scripts and test plans. However, you can resolve the test case associated with the test script using the fields request parameter (see https://jazz.net/wiki/bin/view/Main/RqmApi#fields) and then the test plan associated with the test case.
Thanks for your comment.
Our requirement is to get the test plan name of a script we are going to execute in RQM.i have tried with other approaches but they are showing multiple testplans as a testcase can exists in multiple testplans and our requirement is to get the exact testplan associate with that script.
Is it possible to get the test execution records (TER) using TER name ? After getting TER object i can fetch the test plan information from it.
Best Regards,
Dev.
Comments
Hi Dev,
Yes, you can get the TCER(s) using a fields filter on the title property. However, titles (or names) are not unique so you may find multiple TCERs with the same title property.
To determine the test plan for a test script, you need to know the ID of the TCER (or executionworkitem).
1 vote
how can we get TCER id using RQM REST API ?
Thanks,
Dev Kashyap.
Comments
You can either:
1) GET https://<host>:<port>/<context root>/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<project area alias>/executionworkitem/<executionworkitem ID>?abbreviate=false
2) GET https://<host>:<port>/<context root>/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<project area alias>/executionworkitem?fields=feed/entry/content/executionworkitem<filter>
I would suggest create a simple set of test artifacts (test plan/case/script/execution record/execution result) and experiment with the RQM Reportable REST API to resolve the test plan from the TCER (or executionworkitem).