Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002158TestLinkAPI - XMLRPCpublic2009-02-27 22:002010-05-19 10:17
Reporterpartymungo 
Assigned Tofman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version1.8 RC 4 
Fixed in Version1.9 Beta 2 
Summary0002158: getTestCaseCustomFieldDesignValue returns no value
DescriptionHi,
i try to get the value of a custom field and use the following code:

class TestlinkAPIClient:
  SERVER_URL = "http://localhost/testlink/lib/api/xmlrpc.php" [^]
  DEV_KEY = "415b2ad35607e3548e4554d160a61e4a"
 
  def __init__(self):
    self.server = xmlrpclib.Server(self.SERVER_URL)

  def getTestCaseCustomFieldDesignValue(self, tcid, tpid, customfieldname):
    data = {"devKey":self.DEV_KEY, "testcaseid":tcid, "testplanid":tpid, "customfieldname":customfieldname}
    return self.server.tl.getTestCaseCustomFieldDesignValue(data)


client = TestlinkAPIClient()
x = client.getTestCaseCustomFieldDesignValue(28, 125, "testcase_state")
print x

Note: "DEV_KEY", "testcaseid", "testplanid" and "customfieldname" are valid.

This is what happened if the script is executed:
tester@testsrv:~/testsuite> ./test.py
[]
tester@qstestsrv:~/testsuite>

Additional InformationOS: openSUSE 10.3
Kernel: 2.6.22.19-0.2
TagsNo tags attached.
Database (MySQL,Postgres,etc)
BrowserFirefox 6.0.3
PHP Version5.2.6
TestCaseID
QA Team - Task Workflow Status
Attached Files

- Relationships

-  Notes
(0005676)
fman (administrator)
2009-02-28 00:01

I'm not sure development is finished yet
(0005943)
tstr (reporter)
2009-03-23 16:55

Hi there,

I am needing this API call to be implemented too. By now I don't get to know how the code works for this call, so couldn't help with any patch.

Best regards,

Antonio.
(0006417)
tstr (reporter)
2009-04-16 23:26

Hello fman,

can I get some help to implement this API call by myself? I am willing to take part since I can't wait longer for this functionality.

Regards
Antonio
(0006418)
fman (administrator)
2009-04-17 00:46

You can start reading carefully on cfield_mgr class, because we do not want to duplicate code.
Your code must be reviewed before been added to CVS, to verify it compliat with
our code style and standard naming convention.
When code is finished post here and I will review.
Have little time to give more help than this, if you can not wait till I will implement it.
(0006425)
tstr (reporter)
2009-04-17 15:04

Hi again, I have adapted the already implemented code in function getTestCaseIDByName(). Testing is going to take me longer so, could anyone having a setup please to test it for me?

  public function getTestCaseCustomFieldDesignValue($args)
    {
      $msg_prefix="(" .__FUNCTION__ . ") - ";
      $status_ok=true;
      $this->_setArgs($args);
      
      $checkFunctions = array('authenticate','_checkGetTestCaseCustomFieldDesignValueRequest','checkTestCaseName');
      foreach($checkFunctions as $pfn)
      {
          if( !($status_ok = $this->$pfn()) )
          {
              break;
          }
      }
      
      $status_ok = $status_ok && $this->userHasRight("mgt_view_tc");
      
      if( $status_ok )
      {
    $cf_name=$this->args[self::$customFieldNameParamName];
    $testCaseName = $this->args[self::$testCaseNameParamName];
          $testCaseMgr = new testcase($this->dbObj);
  
          $keys2check = array(self::$testSuiteNameParamName,
                              self::$testProjectNameParamName);
              foreach($keys2check as $key)
              {
                  $optional[$key]=$this->_isParamPresent($key) ? trim($this->args[$key]) : '';
              }
            
          $result = $testCaseMgr->string_custom_field_value($cf_name, $testCaseName,'value');
          if(0 == sizeof($result))
          {
              $status_ok=false;
              $this->errors[] = new IXR_ERROR(NO_CUSTOMFIELD_BY_THIS_NAME,
                                              $msg_prefix . NO_CUSTOMFIELD_BY_THIS_NAME_STR);
              return $this->errors;
          }
      }
  
      return $status_ok ? $result : $this->errors;
}
(0006426)
fman (administrator)
2009-04-17 16:22

1. attach file with code, do not paste function
2. you develop => you test, you can not pass responsible to other people, you can ask others to test also, but you are main responsible

- Issue History
Date Modified Username Field Change
2009-02-27 22:00 partymungo New Issue
2009-02-27 22:00 partymungo Browser => Firefox 6.0.3
2009-02-27 22:00 partymungo PHP Version => 5.2.6
2009-02-28 00:01 fman Note Added: 0005676
2009-03-02 17:40 fman Status new => assigned
2009-03-02 17:40 fman Assigned To => fman
2009-03-23 16:55 tstr Note Added: 0005943
2009-04-16 23:26 tstr Note Added: 0006417
2009-04-17 00:46 fman Note Added: 0006418
2009-04-17 15:04 tstr Note Added: 0006425
2009-04-17 16:22 fman Note Added: 0006426
2009-04-21 16:22 fman Status assigned => resolved
2009-04-21 16:22 fman Fixed in Version => 1.9 (DEV)
2009-04-21 16:22 fman Resolution open => fixed
2010-05-01 20:36 fman Status resolved => closed
2013-04-25 17:30 fman Category TL API => XMLRPC API
2013-04-25 17:30 fman Category XMLRPC API => API - XMLRPC



Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker