How to retrieve Test Case via REST
3 answers
This URL is for the OSLC QM V2 API in RQM 3.0+ (see https://jazz.net/wiki/bin/view/Main/RqmOslcQmV2Api). This format of the URL will return a paged feed of test cases. To GET a specific test case, you would need to know the test case UUID (see the dcterms:identifier property of the test case) or query one of the queryable test case properties (see http://open-services.net/bin/view/Main/QmSpecificationV2?sortcol=table;up=#Resource_TestCase).
To get started, see https://jazz.net/wiki/bin/view/Main/RqmOslcQmV2Api#Getting_Started.
Hi Paul
Thank you for your answer.
When you say "query one of the queryable test case properties" what does that exactly mean? I've tried to add something like this to my url
&oslc.prefix=dcterms=<http://purl.org/dc/terms/>&oslc.selec=*&oslc.where=dcterms:identifier=71
but it doesn't work. As fare as I can understand, then the com.ibm.rqm.planning.VersionedTestCase belongs to the oslc interface while urn:com.ibm.rqm:testcase has something to do with the REST. I have tried to write my url to fit something like this https://localhost:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/JKE+Banking+%28Quality+Management%29/testcase/urn:com.ibm.rqm:testcase:32 but that doesn't work either.
I will take a further look into the links you send me, but I'm not good at understanding all this...
Comments
There are two public RQM APIs:
RQM OSLC API
RQM Reportable REST API
To get test case #32 using the RQM OSLC API:
Request:
GET https://<host>:<port>/<context root>/oslc_qm/contexts/<project area UUID>/resources/com.ibm.rqm.planning.VersionedTestCase?oslc.where=oslc:shortId="32"
Headers:
OSLC-Core-Version = 2.0
Accept = application/xml
To get test case #32 using the RQM Reportable REST API:
Request:
GET https://<host>:<port>/<context root>/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<project area alias>/testcase/urn:com.ibm.rqm:testcase:32?abbreviate=false
Headers:
Accept = application/xml
Fantastic! Thank you, that solved it.
Hi,
Related to this:
I have used the Reportable Rest API to fetch XML about testcases.
Each '<entry>....</entry> (Testcase) contains information about the test case as expected.
There is an '<identifier> element that provides a URL (I assume an OSLC identifier as I used oslclinks=true).
For the same project, but different components/streams
Some of the URLs returned in this identifier can be used to browse to the Testcase in the web view.
But some cannot - they result in an error
"Error
AQXCM5008E The operation cannot be completed because the resource, http://....., was not found."
Why would some of the URLs be browsable, but some not ?