[SOLVED] How to update custom field using reportTCResult API

LATEST Official version.
Questions and discussions - NO ISSUES
FOR ISSUES => http://mantis.testlink.org

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
asidhali
TestLink user
Posts: 9
Joined: Thu Jul 05, 2012 8:00 pm

[SOLVED] How to update custom field using reportTCResult API

Post 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
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: How to update custom field using reportTCResult API

Post by fman »

use PHP sample clients provided with TL installation to fullt understood how call has to be done
asidhali
TestLink user
Posts: 9
Joined: Thu Jul 05, 2012 8:00 pm

Re: How to update custom field using reportTCResult API

Post 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
asidhali
TestLink user
Posts: 9
Joined: Thu Jul 05, 2012 8:00 pm

Re: How to update custom field using reportTCResult API

Post 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.
Post Reply