It's all about the answers!

Ask a question

create a new executionresult for a specific TC with REST-API


Patrick Möller (11) | asked Nov 07 '11, 4:37 a.m.
Hello,

can someone pls give me an example how to create a new executionresult (can be empty - so only neccessary fields filled) with a valid XML File for a specific testcase?

I downloaded the RQMUrlUtility an tried several XML Files, but nothing succeeded. I'd like to create executionresults with a passed or failed state for example the testcase with ID 21.

Can someone give me a xml-file example for this? We use the latest version of RQM.

regards
moellerp

5 answers



permanent link
Robert Rassmann (9923) | answered Nov 08 '11, 5:19 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Hello,

can someone pls give me an example how to create a new executionresult (can be empty - so only neccessary fields filled) with a valid XML File for a specific testcase?

I downloaded the RQMUrlUtility an tried several XML Files, but nothing succeeded. I'd like to create executionresults with a passed or failed state for example the testcase with ID 21.

Can someone give me a xml-file example for this? We use the latest version of RQM.

regards
moellerp


The easiest way to get this is to create a sample execution result in the UI that contains that data that you'll want to set. The do a GET on that resource and you'll have xml that you can use as a template.

permanent link
Patrick Möller (11) | answered Nov 10 '11, 10:52 a.m.

The do a GET on that resource and you'll have xml that you can use as a template.


I did a GET on a specific the executionresult with ID "2".
The output is the following:

<?xml version="1.0" encoding="UTF-8"?>
<executionresult xmlns="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns10="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns12="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns2="http://schema.ibm.com/vega/2008/" xmlns:ns3="http://purl.org/dc/elements/1.1/" xmlns:ns4="http://jazz.net/xmlns/alm/v0.1/" xmlns:ns5="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns6="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns7="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1">
<projectArea href="https://myserver.mydomain.org:9443/qm/resource/itemOid/com.ibm.team.process.ProjectArea/_u0o6gQYGEeGK58zRfTMTew"/>
<ns3:identifier>https://myserver.mydomain.org:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/RQM_SCHULUNG/executionresult/urn:com.ibm.rqm:executionresult:2</ns3:identifier>
<webId>2</webId>
<ns3:title>myTestCase</ns3:title>
<creationDate>2011-11-03T13:55:47.177Z</creationDate>
<ns4:updated>2011-11-03T13:55:47.224Z</ns4:updated>
<ns4:state>com.ibm.rqm.execution.common.state.passed</ns4:state>
<ns4:owner ns5:resource="https://myserver.mydomain.org:9443/jts/resource/itemName/com.ibm.team.repository.Contributor/myuser">myuser</ns4:owner>
<ns6:approvalstate>com.ibm.rqm.planning.common.new</ns6:approvalstate>
<variables/>
<ns6:machine>Local Machine</ns6:machine>
<ns6:iterations>1</ns6:iterations>
<ns6:starttime>2011-11-03T13:55:00.000Z</ns6:starttime>
<ns6:endtime>2011-11-03T13:55:00.000Z</ns6:endtime>
<ns6:weight>100</ns6:weight>
<ns6:pointspassed>0</ns6:pointspassed>
<ns6:pointsfailed>0</ns6:pointsfailed>
<ns6:pointsattempted>0</ns6:pointsattempted>
<ns6:pointsblocked>0</ns6:pointsblocked>
<ns6:pointsinconclusive>0</ns6:pointsinconclusive>
<stateid>_h_IhggYjEeGHn54Zae017g</stateid>
<pointspermfailed>0</pointspermfailed>
<testcase href="https://myserver.mydomain.org:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/RQM_SCHULUNG/testcase/urn:com.ibm.rqm:testcase:1"/>
<executionworkitem href="https://myserver.mydomain.org:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/RQM_SCHULUNG/executionworkitem/urn:com.ibm.rqm:executionworkitem:2"/>
<alias type="string">urn:com.ibm.rqm:executionresult:2</alias>
</executionresult>


The executionresult that I want to post should only have the information in the XML, nothing else.



For me it is not clear:

1) Which of the tags are neccessary and which not (e.g. the webId and the stateid)

2) How I can tell RQM to generate a new id for the executionresult XML I POST to RQM

3) How for example the stateid is generated

Is it my task to generate one or does RQM generate them, when I tell RQM that I whish a new executionresult?

I hope you can help...thx in advance...

permanent link
Patrick Möller (11) | answered Nov 14 '11, 2:05 a.m.
I've got another problem...with this command line:

java.exe -jar C:\Users\myuser\Desktop\rqm_rest_api\RQMUrlUtility.jar -url https://mydomain.org:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/RQM_SCHULUNG/executionresult -filepath D:\temp.xml -user myuser -password mypassword -command POST

I always get a return type 415 (Unsupported Media Type), although I follwed rrassman's instructions an tried to post a modified xml file (created with the get command). the sample TestExecutionRecord RDF/XML (from http://open-services.net/bin/view/Main/QmSpecificationV2Samples?sortcol=table;up=#TestExecutionRecord_RDF_XML), also returns the 415 error.

What did I wrong?

permanent link
Paul Slauenwhite (8.4k12) | answered Dec 05 '11, 8:40 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

The do a GET on that resource and you'll have xml that you can use as a template.


I did a GET on a specific the executionresult with ID "2".
The output is the following:

<xml>
<executionresult>
<projectArea>
<ns3>https://myserver.mydomain.org:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/RQM_SCHULUNG/executionresult/urn:com.ibm.rqm:executionresult:2</ns3>
<webId>2</webId>
<ns3>myTestCase</ns3>
<creationDate>2011-11-03T13:55:47.177Z</creationDate>
<ns4>2011-11-03T13:55:47.224Z</ns4>
<ns4>com.ibm.rqm.execution.common.state.passed</ns4>
<ns4>myuser</ns4>
<ns6>com.ibm.rqm.planning.common.new</ns6>
<variables>
<ns6>Local Machine</ns6>
<ns6>1</ns6>
<ns6>2011-11-03T13:55:00.000Z</ns6>
<ns6>2011-11-03T13:55:00.000Z</ns6>
<ns6>100</ns6>
<ns6>0</ns6>
<ns6>0</ns6>
<ns6>0</ns6>
<ns6>0</ns6>
<ns6>0</ns6>
<stateid>_h_IhggYjEeGHn54Zae017g</stateid>
<pointspermfailed>0</pointspermfailed>
<testcase>
<executionworkitem>
<alias>urn:com.ibm.rqm:executionresult:2</alias>
</executionresult>


The executionresult that I want to post should only have the information in the XML, nothing else.



For me it is not clear:

1) Which of the tags are neccessary and which not (e.g. the webId and the stateid)

2) How I can tell RQM to generate a new id for the executionresult XML I POST to RQM

3) How for example the stateid is generated

Is it my task to generate one or does RQM generate them, when I tell RQM that I whish a new executionresult?

I hope you can help...thx in advance...

1) See https://jazz.net/wiki/bin/view/Main/RqmApi#ScenarioCreateTip.

2) POST will always generate a new ID (see https://jazz.net/wiki/bin/view/Main/RqmApi#Usage_Basics)

3) The stateid does not have to be set on a POST/PUT request (see https://jazz.net/projects/rational-quality-manager/api-doc-3.0/api-files/schemas/qm_xsd/elements/executionresult_2.html#r44).

permanent link
Paul Slauenwhite (8.4k12) | answered Dec 05 '11, 8:42 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
I've got another problem...with this command line:

java.exe -jar C:\Users\myuser\Desktop\rqm_rest_api\RQMUrlUtility.jar -url https://mydomain.org:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/RQM_SCHULUNG/executionresult -filepath D:\temp.xml -user myuser -password mypassword -command POST

I always get a return type 415 (Unsupported Media Type), although I follwed rrassman's instructions an tried to post a modified xml file (created with the get command). the sample TestExecutionRecord RDF/XML (from http://open-services.net/bin/view/Main/QmSpecificationV2Samples?sortcol=table;up=#TestExecutionRecord_RDF_XML), also returns the 415 error.

What did I wrong?


The RQM Reportable REST API uses the RQM XML schema (see https://jazz.net/wiki/bin/view/Main/RqmApi#Detailed_Schema_Documentation), not the OSLC schema (see http://open-services.net/bin/view/Main/QmSpecificationV2). Please follow https://jazz.net/wiki/bin/view/Main/RqmApi#ScenarioCreateTip and use the RQM 3.0.1.1 version of the RQM URL Utility.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.