Cannot add testcase to testplan

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

Cannot add testcase to testplan

Postby jrf2 » Mon Apr 05, 2010 5:30 pm

I am trying to use the testlink API to assign a testcase to a testplan so that I can report the result of the testcase. But regardless of the inputs that I give to the "addTestCaseToTestPlan" function, It always gives me the same error message:
"message(addTestCaseToTestPlan) - Test Case External ID (24) does not exist!code5040"

Eventhough, tl.getTestCaseIDByName reports the external id as 24


If anyone has encountered this problem before or knows what might be the cause of it, your help would be greatly appreciated. Thanks.
TestLink user
Posts: 1
Joined: Mon Apr 05, 2010 5:23 pm

Postby austvik » Wed Apr 07, 2010 12:53 pm

(I don't have any answers, but here are some troubleshooting tips.)

Maybe you could try with id 230 to see that if it reads internal id instead of external id?

Maybe you could check the correct ids in the database?

It might be easier to help you if you post the version you are using, and the code you are using to call tl.addTestCaseToTestPlan().
Advanced user
Posts: 24
Joined: Thu Mar 25, 2010 7:25 am

Re: Cannot add testcase to testplan

Postby brianj » Mon May 03, 2010 9:58 pm

I'm seeing this same problem.

Code: Select all
   def addTestCaseToTestPlan(self, testcaseid, testplanid, projectid):
      version = 1
      data = {"devKey":self.devKey, "testplanid":testplanid, "testcaseexternalid":testcaseid, "version":version, "testprojectid":projectid, "executionorder":1, "urgency":"high" }
print "getting testcaseid from name"
result = client.getTestCaseIDByName("brians_new_test")
print result

# add a test to the test plan
print "adding to test plan..."
result = client.addTestCaseToTestPlan(result[0]['tc_external_id'],31557,29266)
print result

I've double and triple checked the three parameters being sent to "addTestcase", yet I always get back:

[{'message': '(addTestCaseToTestPlan) - Test Case External ID (9071) does not exist!', 'code': 5040}], even though I can see that the 9071 testcase does exist.

I have tried using the testcase id rather than the external id, but it simply reports the same problem.
TestLink user
Posts: 9
Joined: Fri Jan 15, 2010 11:27 pm

Re: Cannot add testcase to testplan

Postby austvik » Sat May 08, 2010 7:47 am

Hi, Brian.

Sounds like a bug.

Would you mind filing a bug report with what you have tried (and maybe with some illustrating selects from the database?)?

Advanced user
Posts: 24
Joined: Thu Mar 25, 2010 7:25 am

Return to XML-RPC API

Who is online

Users browsing this forum: No registered users and 1 guest