How to create Master test plan from Rest API in RQM?
One answer
How to create test management artifacts.
As basics see
Also see https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding for a comprehensive starting point.
You have at least two options: OSLC and the Reportable REST API.
In general see
For OSLC see
A good example about how to create and get using OSLC for EWM is here.
There are very small differences to ETM. I will explain in a bit.
And check this super artifact.
The differences to the EWM code is as follows:
There are creation factories and the related resource shapes for all ETM artifact types such as com.ibm.rqm.planning.VersionedTestCase. E.g.
ResourceType='http://jazz.net/ns/qm/rqm#TestData'
ResourceType='http://jazz.net/ns/qm/rqm#Keyword'
ResourceType='http://jazz.net/ns/qm/rqm#TestSuiteResult'
ResourceType='http://open-services.net/ns/qm#TestExecutionRecord'
ResourceType='http://jazz.net/ns/qm/rqm#TestSuite'
ResourceType='http://open-services.net/ns/qm#TestCase'
ResourceType='http://jazz.net/ns/qm/rqm#BuildRecord'
ResourceType='http://jazz.net/ns/qm/rqm#BuildDefinition'
ResourceType='http://jazz.net/ns/qm/rqm#TestSuiteExecutionRecord'
ResourceType='http://open-services.net/ns/qm#TestPlan'
ResourceType='http://open-services.net/ns/qm#TestScript'
ResourceType='http://open-services.net/ns/qm#TestResult'
Each of these resource types have a creation factory, resource shape etc. Like with EWM, you use the factory URI and do a POST to the factory to create an item.
The request below dies that. It provides the headers ETM seems to only support RDF XML. The request body has to provide the required information. The data below is the minimal data I found for a TestCase.
Request: POST https://elm.example.com:9443/qm/oslc_qm/contexts/_9rYEoFpmEeubKv3DLU7kgg/resources/com.ibm.rqm.planning.VersionedTestCase
Request Headers:
Accept application/rdf+xml;charset=utf-8
Content-type application/rdf+xml;charset=utf-8
X-Jazz-CSRF-Prevent 0000d2li-MEAu1YhSaFAwfkYXG-:f8076ff7-caee-4e1a-867b-a755e5814f2f
OSLC-Core-Version 2.0
Body:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rpm_qm="http://jazz.net/ns/qm/rqm#"
>
<rdf:Description rdf:nodeID="N27262c468079441b9c92f40259d94b18">
<rpm_qm:isSuspect rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</rpm_qm:isSuspect>
<dcterms:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Another Test</dcterms:description>
<rdf:type rdf:resource="http://open-services.net/ns/qm#TestCase"/>
<dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Just a test</dcterms:title>
</rdf:Description>
</rdf:RDF>
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Mar 15 '22, 11:29 a.m.Please do not spam our forum with repeated questions and consider to provide more information than demonstrated here. Read: How should I ask a question in the Forum if I want to receive useful answers?