Page 1 of 1

[SOLVED] How to update custom field using reportTCResult API

Posted: Thu Jul 05, 2012 8:30 pm
by asidhali
Hi,
I am using perl xml rpc library to report test case results. I have a custom field called "config" for each test case during test case execution.
I am not able to find out how to update this custom field using rpc. In http://jetmore.org/john/misc/phpdoc-tes ... rtTCResult they have vaguely mentioned about using map , but I have no idea what that means. I tried using hash , but it did not work too. I was not able to find any sample code on the net too. Can some one please guide me in this regard.

Thanks,
Ashwin

Re: How to update custom field using reportTCResult API

Posted: Fri Jul 06, 2012 5:29 am
by fman
use PHP sample clients provided with TL installation to fullt understood how call has to be done

Re: How to update custom field using reportTCResult API

Posted: Mon Jul 09, 2012 5:41 pm
by asidhali
In the php client examples, "array" is being used.
The equivalent to it in perl is "hash".
So, I tried -

Code: Select all

   my %ash=( "CF_EXE1" => "Configuration","CF_DT"=>"Configuration created by API");
   $response = $client->send_request('tl.reportTCResult',{
            'devKey'             => $APIKey,
            'testcaseexternalid' => $TCXID,
            'testplanid'         => $planID,
            'status'             => $TCStatus,
            'buildid'            => $buildID,
            'notes'              => $TCnotes,
            'platformname'       => $platformName,
            'customfields'       => %ash
            });
and its not working. I tried with key and value instead of CF_EXE1 and CF_DAT. I was still not able to make it work. I am clueless . Please let me know what I am doing wrong.
Thanks

Re: How to update custom field using reportTCResult API

Posted: Mon Jul 09, 2012 6:25 pm
by asidhali
figured it out. Slight part of confusion made me break head on this. working code is given below, for others -

Code: Select all

   $response = $client->send_request('tl.reportTCResult',{
            'devKey'             => $APIKey,
            'testcaseexternalid' => $TCXID,
            'testplanid'         => $planID,
            'status'             => $TCStatus,
            'buildid'            => $buildID,
            'notes'              => $TCnotes,
            'platformname'       => $platformName,
            'customfields'       => {'Configuration'=>'mxp320I'}
            });
Configuration is the CF name, and mxp320I is the CF value.