It's all about the answers!

Ask a question

RQM- Rest API POST request for Execution work Item throwing error 400


Gurnish kaur (1612) | asked Jan 24 '17, 11:01 a.m.

 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"?>

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"?>
<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"?>
<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?

One answer



permanent link
Gurnish kaur (1612) | answered Jan 24 '17, 1:27 p.m.

 Never mind i figured it out. I fixed my XML. Thanks


Comments
Thiruvenkadam Dhanaraj commented Oct 06 '17, 2:36 p.m. | edited Oct 08 '17, 12:44 a.m.

 Hi Gurnish,

 I face the same issue when trying to create execution record for test case.
Could you please tell how did you solve this issue.
Thanks in advance.

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.