RQM- Rest API POST request for Execution work Item throwing error 400
Hi,
RQM version-3.0.1.3
Issue- When doing a post request to create a Execution Work item, server is throwing error 400
Error XML is below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Error xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" xmlns="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns6="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns7="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns10="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1" xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns12="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns2="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/"><statusCode>400</statusCode><message>The uploaded content does not match the XML schema for executionworkitem</message>
I am able to do a GET on execution work item for another test case and its structure looks like following:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><executionworkitem xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" xmlns="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns6="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns7="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns10="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1" xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns12="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns2="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/"><projectArea href="http://host&port/jazz/resource/itemOid/com.ibm.team.process.ProjectArea/_Projectareaid"/><ns4:identifier>http://host&port/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/project alias/executionworkitem/urn:com.ibm.rqm:executionworkitem:480710</ns4:identifier><webId>123456</webId><ns4:title>End to End</ns4:title><ns4:description></ns4:description><creationDate>2017-01-24T14:54:44.982Z</creationDate><ns5:updated>2017-01-24T14:55:50.436Z</ns5:updated><ns4:creator ns3:resource="http://cjt.host&port/jts/resource/itemName/com.ibm.team.repository.Contributor/userid">userid</ns4:creator><ns5:owner ns3:resource="http://cjt.host&port/jts/resource/itemName/com.ibm.team.repository.Contributor/userid">userid</ns5:owner><ns10:frequency>Once</ns10:frequency><ns10:regression>false</ns10:regression><ns10:priority></ns10:priority><ns10:weight>100</ns10:weight><ns10:tags></ns10:tags><testcase href="http://host&port/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/project alias/testcase/urn:com.ibm.rqm:testcase:150012"/><testscript href="http://host&port/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/project alias/testscript/urn:com.ibm.rqm:testscript:1640012"/><currentexecutionresult href="http://host&port/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/project alias/executionresult/urn:com.ibm.rqm:executionresult:462128"/><executionresult href="http://host&port/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/project alias/executionresult/urn:com.ibm.rqm:executionresult:462127"/><executionresult href="http://host&port/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/project alias/executionresult/urn:com.ibm.rqm:executionresult:462128"/></executionworkitem>
The XML i formed for POST is below (for a different test case that did not had a execution work item yet):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><executionworkitem xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" xmlns="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns6="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns7="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns10="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1" xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns12="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns2="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/"><projectArea href="http://host&port/jazz/resource/itemOid/com.ibm.team.process.ProjectArea/__ProjectID"/><ns4:title>Test</ns4:title><ns4:description></ns4:description><creationDate>2017-01-24T14:54:44.982Z</creationDate><ns5:updated>2017-01-24T14:55:50.436Z</ns5:updated><ns10:frequency>Once</ns10:frequency><ns10:regression>false</ns10:regression><ns10:priority></ns10:priority><ns10:weight>100</ns10:weight><ns10:tags></ns10:tags><testcase href="http://host&port/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/project/testcase/urn:com.ibm.rqm:testcase:153430"/><testscript href="http://host&port/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/project/testscript/urn:com.ibm.rqm:testscript:164989"/></executionworkitem>
Please note i changed testcase and testscript numbers in the able XML to the testcase which did not had execution work item in RQM in order to create a new one.
URL used for POST request :
http://host&port/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/projectname/executionworkitem
In my POST request I removed following tags :
< webID> as its minimum occurrence can be zero
<identifier> it was referring to a webID that was not created yet so i removed this tag
<currentexecutionresult> no executionresult exists for this test case and i thought it should be created after execution work item get created.
<executionresult> no executionresult exists for this test case and i thought it should be created after execution work item get created.
MY questions:
1. Can we create Execution work Item without having Execution results for a test case? or we need to first create Execution result using a POST request and then create a Execution work item using another POST referring to Execution result created before?
2. Are<Identifier>,<currentexecutionresult>and <executionresult> tags required in Execution work item POST request?
3. Looking at my above POST XML request do you see any missed data tags?