Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

TestRail API add_section method


#1

I cannot add section to suite (using api)
TestRail v.: 2.7.0.1978
I got this error stack:

[ValidationException] Field Section Parent is not a valid section.

Details:
File: /var/www/testrail/sys/helpers/ex.php
Line: 23
Status Code: 500
Host: 192.168.210.161
Uri: /index.php?/miniapi/add_section/18/5&key=*** (POST)

Browser: Python-urllib/2.7
PHP: 5.3.10-1ubuntu3.4
Server: Linux 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64

name: Automatic tests

Trace:
at ex::raise (ex.php:23)
at ex::raise (controller.php:101)
at Controller->_invoke_web (controller.php:67)
at Controller->_invoke (gizmo.php:108)
at require_once (index.php:106)


#2

Hello,

Thanks for your posting. Could you please try to add the section without specifying a parent section? It seems that the parent section does not exist. You would need to omit the second argument in the URL (the 5), so it’s just:

Thanks again and I look forward to your reply.

Regards,
Tobias


#3

Hello!

In deed, I used ‘5’ as user id by mistake.
In another commands it does not matter and works.
With add_section it was parsed as parent id what was not my goal.

So, Thanks for your help.
Regards


#4

Thanks for the update and great to hear that it works now. Not all API methods expect a second argument, so this parameter is ignored in these cases. Thanks again and just let me know in case there’s anything else I can help with.

Regards,
Tobias


#5

I have one more question about api:

is is any possibility to change assign of test results to ‘Nobody’ (by api)?

If I set assignedto_id field of add_result_for_case method equal to ‘-1’ or '0’
I get ‘Field Assign To is not a valid user.’ Maybe another pattern ?

Thanks for Your support.

Regards,
mrtt


#6

Hello,

This is currently not supported with the API, unfortunately (only through the UI). I’ve added this as a feature request, thank you.

Regards,
Tobias


#7

Hi tgurock,

“is any possibility to change assign of test results to ‘Nobody’ (by api)?”

is that feature added now?

if yes, can you please let me know the userid for Nobody


#8

Hello,

Thanks for your posting! That’s not yet supported but I’ve just added another vote to this request. We usually recommend creating new test runs and the tests would automatically be unassigned in this case. You can alternatively also assign the tests to a “placeholder” user.

Regards,
Tobias


#9

Hello,

Any update on this issue? We still waiting for possibility to assign result to Nobody by API.

Regards,
Mariusz Rakowski