How to update TSER with multiple results of test cases in RQM using REST API
Hi,
we are use in RQM for our automation. We have test suite that contains tests case.
and we are updating the results alone.
1.
I need to create/ update state of Test Case Execution Record. I need to update multiple results of test cases at once(- in one PUT request, by REST API), Is that possible?
I can only successfully create TCER (and update state of TCER), but I want to create multiple TCERs and update multiple TCERs.
(this my PUT request for create TCER:
..../service/com.ibm.rqm.integration.service.IIntegrationService/resources/${project_area}/executionworkitem/urn:com.ibm.rqm:executionworkitem:ID)
2.
Is that possible to create TCER with reference to the one TSER using REST API request?
Thank's
Rachel
7 answers
- You can create multiple test artifacts in a single POST request using bulk upload (see https://jazz.net/wiki/bin/view/Main/RqmApi#Bulk_Upload). However, each update operation has to be a different request. Note, test cases are not associated to test results (see https://jazz.net/products/rational-quality-manager/api-doc-6.0.3/schemas/qm_xsd/complexTypes/abstract-testcase.html). The reference is from test result to test case case execution record to test case.
- There aren't references between TCER and TSER (see https://jazz.net/products/rational-quality-manager/api-doc-6.0.3/schemas/qm_xsd/complexTypes/abstract-executionworkitem.html and https://jazz.net/products/rational-quality-manager/api-doc-6.0.3/schemas/qm_xsd/elements/suiteexecutionrecord.html).
ok.
in order to create TCR, you need its TCER url. (to set in xml data)
I don't know how to create TCER. I created via Excel.
but-
in order to get TCERs url,
you have to make GET request to all TCERs and link each TCR its TCER
(request url = '{serverURL}/service/com.ibm.rqm.integration.service.IIntegrationService/resources/{project name}/executionworkitem')
and now-
You can post the TCRs with the xml attachment.
(request url = '{serverURL}/service/com.ibm.rqm.integration.service.IIntegrationService/resources/{project name}/executionresult')
goodLuck!
rachel
sure,
The XML can be obtained with a GET request:
(request url = '{serverURL}/service/com.ibm.rqm.integration.service.IIntegrationService/resources/{project name}/executionresult/urn:com.ibm.rqm:executionresult:{123=Any ID of TCR- testcaseresult})
sample XML:
<?xml version="1.0" encoding="UTF-8"?>
<ns2:executionresult xmlns:ns2="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns1="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns10="http://open-services.net/ns/core#" xmlns:ns11="http://open-services.net/ns/qm#" xmlns:ns12="http://jazz.net/xmlns/prod/jazz/rqm/process/1.0/" xmlns:ns13="http://www.w3.org/2002/07/owl#" xmlns:ns14="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns15="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns16="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns17="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1" xmlns:ns18="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns20="http://jazz.net/xmlns/alm/qm/styleinfo/v0.1/" xmlns:ns21="http://www.w3.org/1999/XSL/Transform" xmlns:ns3="http://schema.ibm.com/vega/2008/" xmlns:ns4="http://purl.org/dc/elements/1.1/" xmlns:ns5="http://jazz.net/xmlns/prod/jazz/process/0.6/" xmlns:ns6="http://jazz.net/xmlns/alm/v0.1/" xmlns:ns7="http://purl.org/dc/terms/" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1">
<ns2:projectArea href="{projectArea_url}" alias="{projectAlias_url}" />
<ns4:identifier>{result_url}</ns4:identifier>
<ns2:webId>746328</ns2:webId>
<ns4:title>{result_name}</ns4:title>
<ns2:creationDate>2017-08-24T13:37:22.515Z</ns2:creationDate>
<ns6:updated>2017-08-24T13:37:22.655Z</ns6:updated>
<ns6:state>com.ibm.rqm.execution.common.state.failed</ns6:state>
<ns4:creator ns1:resource="{creator_url}">{creator_userName}</ns4:creator>
<ns6:owner ns1:resource="{owner_url}">{owner_userName}</ns6:owner>
<ns2:locked>false</ns2:locked>
<ns16:approvalstate ns1:resource="{server_url}/service/com.ibm.rqm.integration.service.IIntegrationService/process-info/_YlEkMaGWEeanZ-X-zBjfQw/workflowstate/com.ibm.rqm.process.testcaseresult.workflow/com.ibm.rqm.planning.common.new">com.ibm.rqm.planning.common.new</ns16:approvalstate>
<ns2:variables />
<ns16:iterations>1</ns16:iterations>
<ns16:starttime>2017-08-24T13:37:10.628Z</ns16:starttime>
<ns16:endtime>2017-08-24T13:37:21.843Z</ns16:endtime>
<ns16:weight>100</ns16:weight>
<ns16:pointspassed>0</ns16:pointspassed>
<ns16:pointsfailed>100</ns16:pointsfailed>
<ns16:pointsattempted>100</ns16:pointsattempted>
<ns16:pointsblocked>0</ns16:pointsblocked>
<ns16:pointsinconclusive>0</ns16:pointsinconclusive>
<ns2:stateid>_W7oHGYjREeeghrRwe7jNZA</ns2:stateid>
<ns2:pointspermfailed>0</ns2:pointspermfailed>
<ns2:pointsdeferred>0</ns2:pointsdeferred>
<ns16:isCurrent>false</ns16:isCurrent>
<ns16:testcasestateatexecution ns1:resource="{server_url}/service/com.ibm.rqm.integration.service.IIntegrationService/process-info/_YlEkMaGWEeanZ-X-zBjfQw/workflowstate/com.ibm.rqm.process.testcase.workflow/com.ibm.rqm.planning.common.new">com.ibm.rqm.planning.common.new</ns16:testcasestateatexecution>
<ns16:testscriptstateatexecution ns1:resource="{server_url}/service/com.ibm.rqm.integration.service.IIntegrationService/process-info/_YlEkMaGWEeanZ-X-zBjfQw/workflowstate/com.ibm.rqm.process.testscript.workflow/com.ibm.rqm.planning.common.new">com.ibm.rqm.planning.common.new</ns16:testscriptstateatexecution>
<ns16:testedby>
<ns16:tester ns1:resource="{tester_user_url}">{tester_user_name}</ns16:tester>
</ns16:testedby>
<ns16:stepResults />
<ns2:testcase href="{testCase_url}" />
<ns2:testsuitelog href="{testSuiteResult_url}" elementindex="0" />
<ns2:testscript href="{testScript_url}" />
<ns2:labresource href="{labresource_url}" />
<ns2:executionworkitem href="{testCaseExecutionRecord_url}" />
<ns2:attachment href="{attachment_url}" />
<ns2:alias type="string">urn:com.ibm.rqm:executionresult:746328</ns2:alias>
</ns2:executionresult>
Good Luck!
Rachel