MantisBT - TestLink
View Issue Details
0004940TestLinkAPI - XMLRPCpublic2012-03-16 11:262019-06-10 19:21
mnabuco 
 
normalfeature requestN/A
newopen 
Windows 7Enterprise
1.9.3 (2011 Q3 - bug fixing) 
 
MySQL
0004940: XML-RPC API function to create requirements
We're working on a project using the testLink XML-RPC API with Python. We've encountered some issues now because there are no functiond in the API to create, edit and remove requirements.
We would appreciate if you could implement those functions.
No tags attached.
related to 0004492new  API to add/modify Requirement Specifications and Requirements 
related to 0005059new  Added getRequirementByID to xmlrpc.class.php 
related to 0006292new  Add in XMLRPC methods for Requirements Specification and Requirements creation 
? xmlrpc.class.php (159,032) 2012-05-25 06:22
http://mantis.testlink.org/file_download.php?file_id=2689&type=bug
? test.rb (1,764) 2012-05-25 06:23
http://mantis.testlink.org/file_download.php?file_id=2690&type=bug
? xmlrpc.class.php (V2) (165,225) 2012-05-25 08:40
http://mantis.testlink.org/file_download.php?file_id=2691&type=bug
? xmlrpc.class.php (V3) (165,237) 2012-05-28 12:58
http://mantis.testlink.org/file_download.php?file_id=2692&type=bug
? xmlrpc.class.php (V4) (166,836) 2012-07-30 07:39
http://mantis.testlink.org/file_download.php?file_id=2753&type=bug
Issue History
2012-03-16 11:26mnabucoNew Issue
2012-03-16 11:31fmanPriorityurgent => normal
2012-05-24 10:13cvillarNote Added: 0016750
2012-05-24 15:04fmanNote Added: 0016755
2012-05-25 06:22cvillarFile Added: xmlrpc.class.php
2012-05-25 06:23cvillarFile Added: test.rb
2012-05-25 06:37cvillarNote Added: 0016756
2012-05-25 08:37cvillarNote Added: 0016758
2012-05-25 08:39cvillarNote Edited: 0016758bug_revision_view_page.php?bugnote_id=16758#r1811
2012-05-25 08:40cvillarFile Added: xmlrpc.class.php (V2)
2012-05-25 17:14fmanNote Added: 0016767
2012-05-28 12:58cvillarFile Added: xmlrpc.class.php (V3)
2012-05-28 13:02cvillarNote Added: 0016789
2012-06-14 20:00fmanRelationship addedrelated to 0005059
2012-07-30 07:39cvillarFile Added: xmlrpc.class.php (V4)
2012-07-30 07:42cvillarNote Added: 0017028
2012-07-30 10:05fmanNote Added: 0017029
2013-04-25 17:30fmanCategoryTL API => XMLRPC API
2013-04-25 17:30fmanCategoryXMLRPC API => API - XMLRPC
2015-04-29 20:53Mr.BricodageRelationship addedrelated to 0006292
2015-04-29 21:12Mr.BricodageRelationship addedrelated to 0004492
2019-06-10 17:26hejuNote Added: 0028917
2019-06-10 19:21fmanNote Added: 0028918

Notes
(0016750)
cvillar   
2012-05-24 10:13   
Hi,

We're working on a project using the testLink XML-RPC API with Ruby, and we also need to create, edit and remove requirements.

We have implemented the method for creating requirements in {testlink_root}/lib/api/xmlrpc.class.php and it's working fine:

We only need to add the method to the list of methods:

$this->methods = array(....

'tl.createRequirement' => 'this:createRequirement',
....

And the method:

public function createRequirement($args)
    {
        $result=array();
        $this->_setArgs($args);
        $operation=__FUNCTION__;
            $msg_prefix="({$operation}) - ";
            $checkFunctions = array('authenticate','checkTestProjectID');
            $status_ok=$this->_runChecks($checkFunctions,$msg_prefix) && $this->userHasRight("mgt_modify_tc");
      
             if($status_ok)
             {
        $ret = $this->reqMgr->create($this->args['req_spec'],
                         $this->args['document_id'],
                         $this->args['title'],
                                     $this->args['scope'],
                         $this->args['user_id'],
                         $this->args['reqStatus'],
                                     $this->args['reqType'],
                         $this->args['expected_coverage'],
                         $this->args['order']);
             }
       
      
         return $status_ok ? $ret : $this->errors;
    }

Is that feature on the roadmap for the next version?
(0016755)
fman   
2012-05-24 15:04   
>> Is that feature on the roadmap for the next version?
if your code is working well we can add it
(0016756)
cvillar   
2012-05-25 06:37   
Ok, that would be great!

I have improved the method and attached to this ticket "xmlrpc.class.php" and an example of using from a ruby file.

When do you think the next version will be available?

For my project maybe I 'll have to develop more features, so I'll let you know.

Best regards,
(0016758)
cvillar   
2012-05-25 08:37   
(edited on: 2012-05-25 08:39)
Hi.

I have also implemented the createReqSpec and updateReqSpec methods in (V2 file)

(0016767)
fman   
2012-05-25 17:14   
Ok, we are going to review and try to add to 1.9.4
(0016789)
cvillar   
2012-05-28 13:02   
Thanks,

I have also implemented the updateRequirement method in (V3 file), I think is the last I need for my project at the moment.
(0017028)
cvillar   
2012-07-30 07:42   
Hi,

I improved methods changing parameters user_id and project_id to project_prefix and user. It's more useful.
(0017029)
fman   
2012-07-30 10:05   
it's ok if both options are supported (DB ID and Verbose)
(0028917)
heju   
2019-06-10 17:26   
Dear TestLink Team,

I would like to kindly ask for the roadmap for this feature request.

In my project, we are using TestLink for test management and test result tracking / storage, which is working quite well. More or less all test cases are automated, the wonderful https://pypi.org/project/TestLink-API-Python-client/ [^] is used to let the automation framework talk to TestLink.

The proposed functionality of this feature request would facilitate the (automated) import of requirements a lot. Maybe in future the functionality to generate/update requirements can be added to the python client as well.

I think the requirements update/create/get functions would improve the usability of TestLink in scenarios where requirements are organized in an other tool, raising the need for some automated sync mechanism.

 
Best regards
(0028918)
fman   
2019-06-10 19:21   
@heju
can you company consider be the sponsor (make a donation) for this feature?