How to add a testplan id to a suiteexecutionrecord via RqmAPI?
ETM Version: v7.0.3
Looking at these tables in the RqmApi (fields table, resource op table), It appears I should be able to link a testplan to a suiteexecutionrecord via the api.
I am currently doing the following to try and link them:
post create a new testplan
put add suite id to testplan
put add plan id to suiteexecutionrecord
Here is a mock example of the url and xml I am currently trying for the last put:
https://MyEtmHost/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/MyProject/suiteexecutionrecord/urn:com.ibm.rqm:suiteeecutionrecord:12345
<ns0:suiteexecutionrecord ...>
<ns0:projectArea href="..." alias="...">
<ns0:webId>12345</nso:webId>
<dc:title>MySerTitle</dc:title>
<ns0:testplan href=".../testplan/67890" />
<ns0:testsuite href=".../testsuite/87654" />
</ns0:suiteexecutionrecord>
When I call a get on the suiteexecutionrecord after this put the testplan is not in the xml. This same workflow is working for linking the testplan to the executionworkitem, so I am confused what I'm doing wrong.
One answer
The testplan field is immutable, so it cannot be changed after creation (At least through the Reportable REST API).
To set the plan you must include it when creating the suiteexecutionrecord.
"post create a suiteexecutionrecord attached to the testsuite"
should instead be: post create a suiteexecutionrecord attached to the testsuite and testplan
suiteexecutionrecord XML Schema Docs: https://jazz.net/products/test-management/api-doc-7.0.3/schemas/qm_xsd/elements/suiteexecutionrecord.html#a23
Comments
Answering my secondary question in the comments about why executionworkitem can update the testplan but suiteexecution record can't:
testplan IS NOT immutable for executionworkitem, and IS immutable for suiteexecutionrecord. I don't know why they behave different, but it is documented.
https://jazz.net/products/test-management/api-doc-7.0.3/schemas/qm_xsd/elements/suiteexecutionrecord.html#a23
https://jazz.net/products/test-management/api-doc-7.0.3/schemas/qm_xsd/complexTypes/abstract-executionworkitem.html#a41
Comments
William Currier
Oct 09, 5:00 p.m.UPDATE:
If I add the testplan id to the suiteexecutionrecord xml when I first post, it works.
So it seems a testplan just cannot be added to a suiteexecutionrecord after creation.
Is this an expected restriction? Why is it not the same for executionworkitem?