how can custom fields be red from test link 1.9 through xm

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
nkrao123
TestLink user
Posts: 6
Joined: Thu Feb 03, 2011 4:58 pm

how can custom fields be red from test link 1.9 through xm

Post by nkrao123 »

HI All,
how can custom fields be red from test link 1.9 through xml RPC?

Advanced thanks.

Regards
Koti
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: how can custom fields be red from test link 1.9 through

Post by fman »

you will find all info you need on lib\api\xmlrpc.class.php
tom1
Advanced user
Posts: 23
Joined: Thu Nov 11, 2010 4:40 pm

Re: how can custom fields be red from test link 1.9 through

Post by tom1 »

Hi, here are some small examples in perl and python:

Code: Select all

#!/usr/bin/perl -w

use RPC::XML::Client;
use strict;

my $devkey='YOURDEVKEY';
my $testlink_server = 'http://YOURSERVER/testlink/lib/api/xmlrpc.php';
my $xmlrpc_client = RPC::XML::Client->new($testlink_server);

my $testcase_ext_id="XYZ-1";
my $project_id=YOURPROJECTID;
my $customfieldname="YOURFIELDNAME";
my $version=YOURVERSION;

my $customfieldvalue=$xmlrpc_client->send_request('tl.getTestCaseCustomFieldDesignValue', 
   { devKey=>$devkey,
     testcaseexternalid=>$testcase_ext_id, 
     testprojectid=>$project_id, 
     customfieldname=>$customfieldname, 
     version=>$version
   });

print $$customfieldvalue."\n";

Code: Select all

#!/usr/bin/python

import sys,xmlrpclib

URL = "http://YOURSERVER/testlink/lib/api/xmlrpc.php"
DEVKEY = "YOURDEVKEY"
xmlrpc_client = xmlrpclib.Server(URL)

project_id = "YOURPROJECTID"
testcase_ext_id = "XYZ-1"
customfieldname = "YOURFIELDNAME"
version = YOURVERSION
data = {}
data["devKey"] = DEVKEY
data["testprojectid"] = project_id
data["testcaseexternalid"] = testcase_ext_id
data["customfieldname"] = customfieldname
data["version"] = version
customfieldvalue = xmlrpc_client.tl.getTestCaseCustomFieldDesignValue(data)

print customfieldvalue
nkrao123
TestLink user
Posts: 6
Joined: Thu Feb 03, 2011 4:58 pm

Re: how can custom fields be red from test link 1.9 through

Post by nkrao123 »

I did run the perl code to retrieve custom fileds but the print $$customfieldvalue."\n" does not return anything.

How do we retrieve the customfieldvalue after doing a send request?
Is testcaseexternalid the value you see when the gettestCase method is run, indicated as tc_external_id?
tom1
Advanced user
Posts: 23
Joined: Thu Nov 11, 2010 4:40 pm

Re: how can custom fields be red from test link 1.9 through

Post by tom1 »

The testCaseExternalid is the test case id in TestLink GUI (project prefix + glue character + internal id).
e.g.: DEMO-1
tom1
Advanced user
Posts: 23
Joined: Thu Nov 11, 2010 4:40 pm

Re: how can custom fields be red from test link 1.9 through

Post by tom1 »

Is it possible to get the complete testcaseexternalid (project prefix + glue character + internal id) via the api?
I found only a way to get the internal id. It's a roundabout way to get the prefix via getProjects and then the id via getTestCase or getTestCaseIDByName.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: how can custom fields be red from test link 1.9 through

Post by fman »

why you users continue to use one topic to start a subtopic ? this makes our work impossible. Please follow the right pattern to post, that you cna read may be on stackoverflow site
tom1
Advanced user
Posts: 23
Joined: Thu Nov 11, 2010 4:40 pm

Re: how can custom fields be red from test link 1.9 through

Post by tom1 »

Post Reply