Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005059TestLinkContribution Maintained BY USERpublic2012-06-13 22:092012-06-14 20:47
Reportercharles 
Assigned To 
PrioritynormalSeverityfeature requestReproducibilityalways
StatusnewResolutionopen 
Platformx86OSLinuxOS Version2.6.32-5
Product Version1.9.3 (2011 Q3 - bug fixing) 
Fixed in Version 
Summary0005059: Added getRequirementByID to xmlrpc.class.php
DescriptionI have need to access requirement information via the API, so I added tl.getRequirementByID to the xmlrpc.class.php file.

Do you want a patch file?

If so, do you have docs describing what kind of file format you want, and what I should use as the reference file?
Steps To ReproduceInteresting bit(function definition), the ...Name variables need adding, and the method name needs adding to the methods array as well.


  /**
   * Fetches a Requirement by it's ID and Version ID.
   *
   *
   * @param struct $args
   * @param string $args["devKey"]
   * @param string $args["requirementid"]
   * @param string $args["requirementversionid"]
   * @return mixed $resultInfo
   */
  public function getRequirementByID($args)
  {
    $msg_prefix="(" .__FUNCTION__ . ") - ";
    $status_ok=true;
    $this->_setArgs($args);
    $result = null;
    $errors = null;

    $checkFunctions = array('authenticate');
    $status_ok=$this->_runChecks($checkFunctions,$msg_prefix) && $this->userHasRight("mgt_view_tc");
      
    if( $status_ok )
      {
    $requirementID = $this->args[self::$requirementIDParamName];
    $requirementVersionID = $this->args[$requirementVersionIDParamName];

    $result = $this->reqMgr->get_by_id($requirementID, $requirementVersionID);

    if (count($result) == 0)
      {
        $status_ok=false;
        $msg = sprintf(REQ_KO_STR, $requirementID);
        $errors = array('status_ok' => false, 'error_msg' => $msg , 'error_code' => REQ_KO);
      }
      }
    return $status_ok ? $result : $this->errors;
  }
TagsNo tags attached.
Database (MySQL,Postgres,etc)postgres
Browser
PHP Version
TestCaseID
QA Team - Task Workflow Status
Attached Files? file icon xmlrpc.class.php [^] (158,001 bytes) 2012-06-14 19:10

- Relationships
related to 0004940new XML-RPC API function to create requirements 

-  Notes
(0016885)
fman (administrator)
2012-06-14 18:53

We prefer to work with FULL FILES, and do diff by ourselves.
Please provide all files needed, or confirm only thing to do is add posted code on xmlrpc server class.
(0016886)
charles (reporter)
2012-06-14 19:11

I attached the file to this defect, let me know if you want it somewhere else.

Thanks!
(0016888)
fman (administrator)
2012-06-14 19:57

Ok, I think we are going change method name to getRequirement()
It would be great if you also provide the clientGetRequirement.php to test it
(0016889)
charles (reporter)
2012-06-14 20:24

Sure thing,

Might be take bit though, I actually call it from C# so I don't have any php client code laying around. I can definitely get it to you by the weekend.
(0016890)
fman (administrator)
2012-06-14 20:47
edited on: 2012-06-14 20:47

Thanks
having also C# examples will be a must


- Issue History
Date Modified Username Field Change
2012-06-13 22:09 charles New Issue
2012-06-14 18:53 fman Note Added: 0016885
2012-06-14 19:10 charles File Added: xmlrpc.class.php
2012-06-14 19:11 charles Note Added: 0016886
2012-06-14 19:57 fman Note Added: 0016888
2012-06-14 20:00 fman Relationship added related to 0004940
2012-06-14 20:24 charles Note Added: 0016889
2012-06-14 20:47 fman Note Added: 0016890
2012-06-14 20:47 fman Note Edited: 0016890 View Revisions



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker