How to update a testcaseresult (executionresult) with a different iteration (testphase) using the REST API
![](http://jazz.net/_images/myphoto/8e88081e4dd4e88ec8b6d56ddb48a968.jpg)
Hi I am using Postman and the REST API to update a testcaseresult (aka executionresult) with a different iteration (aka testphase).
I will leave out the authentication piece as this is working as per the guidance here: Using Postman to issue a HTTP(S) request (ibm.com)
We are on version 6.0.6.1 of RQM and Jazz.
Firstly, I perform a GET to pull the xml for an testcaseresult (aka executionresult) :
This works and brings back my testcaseresult (aka executionresult) :
<?xml version="1.0" encoding="UTF-8"?>
<ns2:executionresult...>
<ns2:testphase href="https://{server:port}/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/{project}/testphase/urn:com.ibm.rqm:testphase:72"/>
Secondly, I take that payload and modify the testphase to :
<ns2:testphase href="https://{server:port}/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/{project}/testphase/urn:com.ibm.rqm:testphase:227"/>
Which is the testphase I want and is in the correct test plan schedule.
Lastly, I then use this as my body payload for a PUT with the same url as above. The return is a 200 Okay:
<entry xmlns:rqm="http://schema.ibm.com/rqm/2007#executionresult" xmlns="http://www.w3.org/2005/Atom">
<rqm:resultId xmlns:rqm="http://schema.ibm.com/rqm/2007#executionresult">1111</rqm:resultId>
<rqm:resultItemId xmlns:rqm="http://schema.ibm.com/rqm/2007#executionresult">{someStateId}</rqm:resultItemId>
<rqm:resultExternalId xmlns:rqm="http://schema.ibm.com/rqm/2007#executionresult">urn:com.ibm.rqm:executionresult:1111</rqm:resultExternalId>
</entry>
This tells me that it has worked but it did not update the iteration (aka testphase).
Interestingly, this is not shown as an editable or linked item in the UI:
Please note that I can successfully update other fields in the testcaseresult (aka executionresult).
Any light anyone can shed on this would be much appreciated
Regards,
Danny.
One answer
![](http://jazz.net/_images/myphoto/8e88081e4dd4e88ec8b6d56ddb48a968.jpg)
Test phase is NOT set directly from the execution result. It is always extracted from the associated TER.
Comments
![](http://jazz.net/_images/myphoto/8e88081e4dd4e88ec8b6d56ddb48a968.jpg)
Hi Subhajit,