MantisBT - TestLink
View Issue Details
0004188TestLinkAPI - XMLRPCpublic2011-01-25 20:232015-05-01 07:42
denjolras 
 
normalfeature requestN/A
closedfixed 
1.9 (Prague) 
1.9.14 (2015 Q3) 
MySQL
READY FOR TESTING
0004188: feature request - new method - getTestSuiteCustomFieldValue
As Custom field can be used for TestSuite,
could you add a "getTestSuiteCustomFieldDesignValue" Method ?

Thanks.
No tags attached.
? xmlrpc.class.php (186,983) 2011-08-27 18:27
http://mantis.testlink.org/file_download.php?file_id=2504&type=bug
? requirement_spec_mgr.class.php (68,625) 2011-08-27 18:27
http://mantis.testlink.org/file_download.php?file_id=2506&type=bug
? requirement_mgr.class.php (101,795) 2011-08-27 18:28
http://mantis.testlink.org/file_download.php?file_id=2507&type=bug
Issue History
2011-01-25 20:23denjolrasNew Issue
2011-01-25 21:55fmanSummaryCould you add a "getTestSuiteCustomFieldDesignValue" Method ? => feature request - new method - getTestSuiteCustomFieldValue
2011-01-25 21:57fmanNote Added: 0013433
2011-01-26 00:00kinowNote Added: 0013434
2011-01-26 00:00kinowAssigned To => kinow
2011-01-26 00:00kinowStatusnew => assigned
2011-01-27 10:04fmanNote Added: 0013445
2011-01-27 10:34kinowNote Added: 0013447
2011-01-28 10:33fmanNote Added: 0013462
2011-01-28 11:47kinowNote Added: 0013463
2011-04-22 20:37denjolrasNote Added: 0014738
2011-04-22 20:59kinowNote Added: 0014739
2011-05-08 14:59kinowStatusassigned => work in progress
2011-07-18 15:43JulianNote Added: 0015524
2011-07-18 22:16kinowNote Added: 0015528
2011-08-01 01:56kinowNote Added: 0015574
2011-08-03 01:52kinowNote Added: 0015580
2011-08-03 01:53kinowNote Added: 0015581
2011-08-03 01:53kinowStatuswork in progress => assigned
2011-08-03 01:59kinowFile Added: xmlrpc.class.php
2011-08-06 15:01kinowNote Added: 0015606
2011-08-06 15:02kinowNote Edited: 0015606bug_revision_view_page.php?bugnote_id=15606#r1386
2011-08-06 15:17fmanNote Added: 0015609
2011-08-06 15:31kinowNote Added: 0015611
2011-08-18 12:12kinowNote Added: 0015711
2011-08-22 22:45kinowStatusassigned => work in progress
2011-08-23 00:50kinowNote Edited: 0015606bug_revision_view_page.php?bugnote_id=15606#r1433
2011-08-23 00:52kinowNote Added: 0015735
2011-08-23 07:52fmanNote Added: 0015738
2011-08-23 09:01kinowNote Added: 0015742
2011-08-27 18:26kinowFile Deleted: xmlrpc.class.php
2011-08-27 18:27kinowFile Added: xmlrpc.class.php
2011-08-27 18:27kinowFile Added: requirements.inc.php
2011-08-27 18:27kinowFile Added: requirement_spec_mgr.class.php
2011-08-27 18:27kinowFile Deleted: requirements.inc.php
2011-08-27 18:28kinowFile Added: requirement_mgr.class.php
2011-08-27 18:33kinowNote Added: 0015760
2011-08-27 18:34kinowStatuswork in progress => assigned
2011-09-05 21:00fmanNote Added: 0015798
2012-03-26 19:39franco.gonzalezNote Added: 0016477
2012-04-03 01:44kinowNote Added: 0016489
2012-04-11 07:09kinowNote Added: 0016558
2012-04-11 07:09kinowStatusassigned => feedback
2012-04-11 09:03fmanNote Added: 0016559
2012-04-11 09:13kinowNote Added: 0016560
2012-04-11 18:04fmanNote Added: 0016561
2013-04-25 17:30fmanCategoryTL API => XMLRPC API
2013-04-25 17:30fmanCategoryXMLRPC API => API - XMLRPC
2015-04-29 21:09Mr.BricodageNote Added: 0023272
2015-05-01 07:42fmanQA Team - Task Workflow Status => READY FOR TESTING
2015-05-01 07:42fmanStatusfeedback => closed
2015-05-01 07:42fmanAssigned Tokinow =>
2015-05-01 07:42fmanResolutionopen => fixed
2015-05-01 07:42fmanFixed in Version => 1.9.14 (2015 Q3)

Notes
(0013433)
fman   
2011-01-25 21:57   
Reminder sent to: kinow

can you take care of this ?
(0013434)
kinow   
2011-01-26 00:00   
@fman: Okeydokey, I know the TL API code already, so hopefully I won't take too long to finish it. BTW, A custom field can be associated to "Test Suite", "Test Plan", "Test Case" (already implemented), "Requirements Specification Document" and "Requirement". Should I write the code only for "Test Suite", or for all the other as well (i.e.: getTestSuiteCustomFieldDesignValue, getTestPlanCustomFieldDesignValue, getTestSuiteCustomFieldDesignValue, ...)?
Cheers
(0013445)
fman   
2011-01-27 10:04   
JUST ONE generic
getCFvalue(itemtype,area)

itemtype: testsuite,testproject, and so on
area: design, execution, testplan design (see inside cfield_mgr class)
(0013447)
kinow   
2011-01-27 10:34   
Got it. Just like we did for the upload attachment. Thanks.
(0013462)
fman   
2011-01-28 10:33   
OK BUT JUST ONE method exposed:
getCFvalue() for anythings including test cases

and we will mantain for backwards compatibility the existent method that works ONLY on test cases

let me know if this is clear
(0013463)
kinow   
2011-01-28 11:47   
Ok, I think I understood it. All I have to do is add getCFValue method and keep the old one for backward compatibility. No need to add the other methods (for test plan, test suite, etc).
(0014738)
denjolras   
2011-04-22 20:37   
Any way I can help you ?
(0014739)
kinow   
2011-04-22 20:59   
I'm working on this issue during Easter. It would be great if you could test it when the code is ready. :-)
(0015524)
Julian   
2011-07-18 15:43   
Can this issue be resolved?
(0015528)
kinow   
2011-07-18 22:16   
Not yet Julian, sorry, I stopped in the middle of the implementation. I can get the work on this issue back in a couple of days.
(0015574)
kinow   
2011-08-01 01:56   
@Julian: Just a quick feedback, 90% done. Just finishing to test this new feature and preparing to synchronize and attach the sources here.
(0015580)
kinow   
2011-08-03 01:52   
I finished a first implementation, could somebody analyse the code and merge it if everything is ok, please? It is attached to this issue.

The method getCustomFieldValue() is an internal method to retrieve custom field values. It is not exposed in the XMl-RPC. The existent getTestCaseCustomFieldDesignValue() method was kept intact for backward compatibility.

Now, besides getTestCaseCustomFieldDesignValue(), the API contains the following methods:

- getTestCaseCustomFieldExecutionValue()
- getTestCaseCustomFieldTestPlanDesignValue()
- getTestSuiteCustomFieldDesignValue()
- getTestPlanCustomFieldDesignValue()
- getReqSpecCustomFieldDesignValue()
- getRequirementCustomFieldDesignValue()

All these methods use getCustomFieldValue() to retrieve the custom field values in certain scopes.

Cheers, Bruno
(0015581)
kinow   
2011-08-03 01:53   
Finished writing code.
(0015606)
kinow   
2011-08-06 15:01   
(edited on: 2011-08-23 00:50)
Hi Francisco,

1. Will do it today :) thanks
2. My bad, the way I code in Java sometimes influences me badly
3. Will try to remember that, I was coding for so long that couldn't see the wood for the trees
4. I will search where I used project id and replace it with test project id, it makes more sense to use test project id instead of project id indeed, thanks!

I am mistakenly using the parameter name "version", however I am using it as node_id in the code. Perhaps it is just a matter of changing from "version" to "version_id"? I think I used the $versionNumberParamName because I couldn't find a $versionIDParamName... but probably I didn't search enough.

Give me some time to fix all these errors and I will upload the file here again, ok?

Thank you for putting your time into reviewing my code Francisco :)

Cheers, Bruno

(0015609)
fman   
2011-08-06 15:17   
please use code you will get from 1.9 branch. just commited NOT TESTED
(0015611)
kinow   
2011-08-06 15:31   
Hmm, I will have to figure out another way then, instead of asking for the version ID. I will start committing to 1.9 branch and will drop a note here in Mantis on the issues affected by my code for further review.

I am feeling more comfortable with TestLink code, so I guess I can start working more on TestLink.

Thanks for your help too.

This was the reason why I stopped contributing here for a while, but now I am already getting the gist of this new job and have more time to contribute to Open Source projects. Have a great weekend, I will review what was done in this issue and commit during the following days.
(0015711)
kinow   
2011-08-18 12:12   
@fman: Sorry for taking long to reply Francisco. I will work on this issue on next Monday till Friday. I'm a little busy this week, but I'll have the nights off to work in TestLink by the next week. I believe we will be able to have this fixed for 1.9.4.
(0015735)
kinow   
2011-08-23 00:52   
@fman: Hey Francisco,

Looks like you fixed most of things you pointed in your comments :-) Thanks!

Just to make sure, the only thing missing is replace versionId by the actual entity Id (test case id, test suite id, etc) plus a version number, when necessary, right?

All my code is synchronized against testlink_1_9 and I'm ready to start fixing it :)

Thanks again. Bruno.
(0015738)
fman   
2011-08-23 07:52   
>>Just to make sure, the only thing missing is replace versionId by the actual >>entity Id (test case id, test suite id, etc) plus a version number, when >>necessary, right?
no this way, example for test case:
if you provide test case external ID + VERSION NUMBER then you NEED to GET TCVERSION ID

TestSuites HAS NO VERSIONS

for req you can have to use VERSION
for req spec you have to use REVISION

Think you need to give a look to HOW is managed when you work from GUI
(0015742)
kinow   
2011-08-23 09:01   
Great! I will try to keep it as similar as the behavior from the GUI. Cold weather here, good to stay home and program PHP in TestLink :) Thanks Francisco.
(0015760)
kinow   
2011-08-27 18:33   
@fman: Hi Francisco, I added revision to req spec, version to requirements and some extra verifications for test cases. As you suggested, I checked out how the UI works and also tried to stick with ID's available to the user in the screen (like version number, instead of version id). I tried to push my changes to testlink-code/testlink_1_9 but it seems like I cannot commit there, so I am attaching the modified files here.

Notes about this implementation:

I left the execution id to be used when retrieving custom fields for test case in executions. Is there a better way of doing so?

I only used existent messages, however there are no messages for revisions, for example. Would it be a problem?

Hope the code is better than the last time I attached here, if you find any flaw, please let me know and I will try to fix or code differently before 1.9.4 release.

I will be out of country from 31 August till beginning of September, so I'm afraid I won't be able to help testing this new version :-(

Thank you in advance!
Bruno
(0015798)
fman   
2011-09-05 21:00   
first commit on 2.0
http://gitorious.org/testlink-ga/testlink-code/commit/3e792cdd0cb51c278464b59d83ae5f67a977cc56 [^]

test needed
(0016477)
franco.gonzalez   
2012-03-26 19:39   
getCustomFieldValue the class method invokes the method xmlrpc.class.php 'checkCustomField' which is not implemented.
(0016489)
kinow   
2012-04-03 01:44   
Hello Franco! I'll look at this issue tomorrow, I've been busy but this week I'm back working on TestLink :-) Get back to you soon with a feedback on this issue.

Bruno
(0016558)
kinow   
2012-04-11 07:09   
Hi again Franco! You were right indeed, sorry for taking long to get back to you.

I believe I have fixed it, could you have a look at it, please?

Cheers, Bruno
(0016559)
fman   
2012-04-11 09:03   
@kinow:
where is the fix ?
in gitorious repo ?
is not clear
(0016560)
kinow   
2012-04-11 09:13   
@fman: My bad. Here are the links:

File:
branch testlink_1_9: https://gitorious.org/testlink-ga/testlink-code/blobs/3af56f46ecc0038647b8a0de253faba5515bd004/lib/api/xmlrpc.class.php#line4690 [^]
branch master: https://gitorious.org/testlink-ga/testlink-code/blobs/626e4fa23dab86c847d10facf660799d6786a314/lib/api/xmlrpc.class.php#line4560 [^]

Commits:
branch testlink_1_9: https://gitorious.org/testlink-ga/testlink-code/commit/3af56f46ecc0038647b8a0de253faba5515bd004 [^]
branch master: https://gitorious.org/testlink-ga/testlink-code/commit/626e4fa23dab86c847d10facf660799d6786a314 [^]

I tested with a simple Python client and it worked fine, no http errors, no warnings or whatsoever.
(0016561)
fman   
2012-04-11 18:04   
Bruno:
please can you detail test cases you have run ?
(0023272)
Mr.Bricodage   
2015-04-29 21:09   
getTestSuiteCustomFieldDesignValue() is present with 1.9.14.
No feedback since 2012.