Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How can I get xml schema for posting execution result using rest api

Hi,

I created a manual testscript in RQM 4.0. I was able to get this testscript using rest method GET. I received xml file and everything was ok. Now I want to insert to this testscript execution result. So i genereted xml file that looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<ns2:testscript xmlns:ns2="http://jazz.net/xmlns/alm/qm/v0.1/"
    xmlns:ns1="http://schema.ibm.com/vega/2008/" xmlns:ns10="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1"
xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1"
xmlns:ns3="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1" xmlns:ns4="http://purl.org/dc/elements/1.1/"
xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" xmlns:ns6="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1"
xmlns:ns7="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1"
xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/">
<ns4:identifier>null</ns4:identifier>
<ns4:title>AutoGenerated_TestScriptWyniki</ns4:title>
<ns4:description>null<ns4:description>
<ns4:creator>null</ns4:creator>
<ns5:owner>null</ns5:owner>
<ns2:scripttype>null</ns2:scripttype>
<ns2:steps>
<stepResult xmlns="null" endTime="99055293"
result="com.ibm.rqm.execution.common.state.failed" startTime="99055293">
<startTime>99055293</startTime>
<endTime>99055293</endTime>
<result>com.ibm.rqm.execution.common.state.failed</result>
<expectedResult>
1 </expectedResult>
<actualResult>Beginning of the interval: , End of the interval: Testcase = 2147483647
(C)CMDRUN#1000 $TARGET_HOSTNAME$ mkdir $DIRECTORY_NAME$ /opt ;
com.ibm.tivoli.cat.generic.remotex.RemoteXException: RemoteX Error: Execute command at nc045099.kraklab.pl.ibm.com failed for command: mkdir TEST999 mkdir: cannot create directory `TEST999&#039;: File exists
;
</actualResult> <description>
Costam robimy krok pierwszy </description>
<stepType>com.ibm.rqm.execution.common.elementtype.execution </stepType>
</stepResult></ns2:steps>
</ns2:testscript>

I found how my url should be defined in https://jazz.net/wiki/bin/view/Main/RqmApi#Create.
But I receive HTTP status code 400 (syntax error). Do anybody know if my xml is thine and I should change something else? Or where I can find xml schema for this?

Thanks in advance :)

0 votes



5 answers

Permanent link
You can do a GET on existing Execution Result and follow that. null is not valid script type.

0 votes


Permanent link
So I should GET a xml representing existing Execution Result and only add this field?

<actualresult>Beginning of the interval:  , End of the interval: Testcase = 2147483647
(C)CMDRUN#1000	$TARGET_HOSTNAME$	mkdir $DIRECTORY_NAME$	/opt ;
com.ibm.tivoli.cat.generic.remotex.RemoteXException: RemoteX Error: Execute command at nc045099.kraklab.pl.ibm.com failed for command: mkdir TEST999 mkdir: cannot create directory `TEST999': File exists
;
</actualresult>

0 votes


Permanent link
No. You need to modify most of the field. But the structure will remain almost same. Use the XML that you got from GET as reference

0 votes


Permanent link
Could you give me more specific information on what I should change in my xml?
I changed this part to values that I received from GET method. What should I do next?

PS. Thanks for your help :)

<ns4:identifier>null</ns4:identifier>
    <ns4:title>AutoGenerated_TestScriptWyniki</ns4:title>
    <ns4:description>null<ns4:description>
    <ns4:creator>null</ns4:creator>
    <ns5:owner>null</ns5:owner>
    <ns2:scripttype>null</ns2:scripttype>


Changed to:
 
<ns3:identifier>
		https://host:9443/qm/service/com.ibm.rqm.integration.service.IIntegrati
onService/resources/Project1/testscript/urn:com.ibm.rqm:testscript:2
</ns3:identifier>
<ns4:title>TestScriptWyniki</ns4:title>
<ns4:description />
<ns4:creator
ns6:resource="https://host:9443/jts/resource/itemName/com.ibm.team.repository.Contributor/Administrator">Administrator</ns4:creator>
<ns5:owner>unassigned</ns5:owner>
<ns2:scripttype>com.ibm.rqm.planning.common.scripttype.manual</ns2:scripttype>

0 votes


Permanent link
You are looking to POST ExecutionResult not Test Script. So, your xml should follow the xml of Execution Result GET. I am giving one example of Execution Result XML.

<?xml version="1.0" encoding="UTF-8"?><ns2:executionresult xmlns:ns2="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns1="http://schema.ibm.com/vega/2008/" xmlns:ns3="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 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/tsl/v0.1/" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns10="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns12="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns13="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns14="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1" xmlns:ns16="http://jazz.net/xmlns/alm/qm/styleinfo/v0.1/" xmlns:ns17="http://www.w3.org/1999/XSL/Transform"><ns2:projectArea alias="Quality+Manager" href="https://localhost:9443/jazz/resource/itemOid/com.ibm.team.process.ProjectArea/_stJVgGfqEd24KMoDcFLfcQ"/><ns4:identifier>https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionresult/urn:com.ibm.rqm:executionresult:1</ns4:identifier><ns2:webId>1</ns2:webId><ns4:title>Hi</ns4:title><ns2:creationDate>2012-12-21T09:16:21.328Z</ns2:creationDate><ns6:updated>2012-12-21T09:17:17.565Z</ns6:updated><ns6:state>com.ibm.rqm.execution.common.state.failed</ns6:state><ns6:owner ns3:resource="https://localhost:9443/jazz/resource/itemName/com.ibm.team.repository.Contributor/TestJazzAdmin1">TestJazzAdmin1</ns6:owner><ns2:locked>false</ns2:locked><ns13:approvalstate ns3:resource="https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/process-info/_stJVgGfqEd24KMoDcFLfcQ/workflowstate/com.ibm.rqm.process.testcaseresult.workflow/com.ibm.rqm.planning.common.new">com.ibm.rqm.planning.common.new</ns13:approvalstate><ns2:variables/><ns13:machine>Local Computer</ns13:machine><ns13:iterations>1</ns13:iterations><ns13:starttime>2012-12-21T09:16:21.328Z</ns13:starttime><ns13:endtime>2012-12-21T09:17:16.732Z</ns13:endtime><ns13:weight>100</ns13:weight><ns13:pointspassed>67</ns13:pointspassed><ns13:pointsfailed>33</ns13:pointsfailed><ns13:pointsattempted>100</ns13:pointsattempted><ns13:pointsblocked>0</ns13:pointsblocked><ns13:pointsinconclusive>0</ns13:pointsinconclusive><ns2:stateid>_NzrbwEtPEeK1ud3LwtX4pw</ns2:stateid><ns2:pointspermfailed>0</ns2:pointspermfailed><ns2:pointsdeferred>0</ns2:pointsdeferred><ns13:stepResults><ns13:stepResult ns1:id="_FcUIMEtPEeK1ud3LwtX4pw" stepIndex="1" endTime="2012-12-21T09:17:14.087Z" result="com.ibm.rqm.execution.common.state.failed" startTime="2012-12-21T09:17:14.087Z"><ns13:properties><ns13:property propertyType="rtcdefectView" propertyValue="https://localhost:9443/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/1" propertyName="1: Failing Test Case &quot;Hi&quot;"/></ns13:properties><ns13:startTime>2012-12-21T09:17:14.087Z</ns13:startTime><ns13:endTime>2012-12-21T09:17:14.087Z</ns13:endTime><ns13:result>com.ibm.rqm.execution.common.state.failed</ns13:result><ns13:description><div:div xmlns:div="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml">hi</div:div></ns13:description><ns13:stepType>com.ibm.rqm.execution.common.elementtype.execution</ns13:stepType><ns13:comment/><ns13:compare/></ns13:stepResult><ns13:stepResult ns1:id="_FcfuZktPEeK1ud3LwtX4pw" stepIndex="2" endTime="2012-12-21T09:17:15.537Z" result="com.ibm.rqm.execution.common.state.passed" startTime="2012-12-21T09:17:15.537Z"><ns13:startTime>2012-12-21T09:17:15.537Z</ns13:startTime><ns13:endTime>2012-12-21T09:17:15.537Z</ns13:endTime><ns13:result>com.ibm.rqm.execution.common.state.passed</ns13:result><ns13:description><div:div xmlns:div="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml">hello</div:div></ns13:description><ns13:stepType>com.ibm.rqm.execution.common.elementtype.execution</ns13:stepType><ns13:comment/><ns13:compare/></ns13:stepResult><ns13:stepResult ns1:id="_FciKoEtPEeK1ud3LwtX4pw" stepIndex="3" endTime="2012-12-21T09:17:16.732Z" result="com.ibm.rqm.execution.common.state.passed" startTime="2012-12-21T09:17:16.732Z"><ns13:startTime>2012-12-21T09:17:16.732Z</ns13:startTime><ns13:endTime>2012-12-21T09:17:16.732Z</ns13:endTime><ns13:result>com.ibm.rqm.execution.common.state.passed</ns13:result><ns13:description><div:div xmlns:div="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml">bye</div:div></ns13:description><ns13:stepType>com.ibm.rqm.execution.common.elementtype.execution</ns13:stepType><ns13:comment/><ns13:compare/></ns13:stepResult></ns13:stepResults><ns2:testcase href="https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/testcase/urn:com.ibm.rqm:testcase:1"/><ns2:testscript href="https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/testscript/urn:com.ibm.rqm:testscript:1"/><ns2:executionworkitem href="https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionworkitem/urn:com.ibm.rqm:executionworkitem:1"/><ns2:alias type="string">urn:com.ibm.rqm:executionresult:1</ns2:alias></ns2:executionresult>

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,941

Question asked: Jan 04 '13, 11:01 a.m.

Question was seen: 7,184 times

Last updated: Jan 07 '13, 8:46 a.m.

Confirmation Cancel Confirm