It's all about the answers!

Ask a question

How to update a testcaseresult (executionresult) with a different iteration (testphase) using the REST API


Daniel Crone (41) | asked Jan 06 '21, 10:28 a.m.

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) :

https://{server:port}/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/{project}/executionresult/urn:com.ibm.rqm:executionresult:1111

 

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



permanent link
Subhajit Bhuiya (5972) | answered Jan 07 '21, 2:18 a.m.
JAZZ DEVELOPER

Test phase is NOT set directly from the execution result.  It is always extracted from the associated TER.


From the schema documentation
[READ-ONLY] Since 2.0.0.1.  The Test Phase associated with the test execution.  Note, resolved from the associated executionworkitem.


Comments
Daniel Crone commented Jan 07 '21, 3:06 a.m.

Hi Subhajit, 

Thanks for that, interestingly, I had already updated the TER test phase, this is why I was trying to update the TR to bring it in line, so it would appear that it does not extract it from the current version of the TER? What would I need to do to bring these two in line?
Also I had a look at executionresult.xsd and could not find the reference to testphase, which xsd should I be looking at please?

Your answer


Register or to post your answer.