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

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

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?

0 votes



One answer

Permanent link

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

1 vote

Comments

 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 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
× 479
× 31

Question asked: Jan 24 '17, 11:01 a.m.

Question was seen: 4,663 times

Last updated: Oct 08 '17, 12:44 a.m.

Confirmation Cancel Confirm