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

Add_results_for_cases or add_result_for_cases is failing to post result into Testrail


#1

add_results_for_cases or add_result_for_case are failing to post result into Testrail. I tried both add_results_for_cases:
Host: testrail01:xxxx
Uri: /testrail/index.php?/api/v2/add_result_for_case/1402 (POST)
{‘comment’: ‘Test Passed Successfully’, ‘case_id’: u’35055’, , ‘status_id’: ‘1’}]

add_result_for_case
add_results_for_cases:
Host: testrail01:xxxx
Uri: /testrail/index.php?/api/v2/add_result_for_case/1402/35055 (POST)
{‘comment’: ‘Test Passed Successfully’, ‘status_id’: ‘1’}]

Error log:

[ValidationException] Field :version is a required field.

Details:
File: C:\inetpub\wwwroot\testrail\sys\helpers\ex.php
Line: 25
Status Code: 500
Host: testrail01:xxxx
Uri: /testrail/index.php?/api/v2/add_result_for_case/1402/35055 (POST)

[{‘comment’: ‘Test Passed Successfully’, ‘status_id’: ‘1’}]


Browser: Python-urllib/2.7
PHP: 5.4.24
Server: Windows NT 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586

Trace:
at ex::raise (ex.php:25)
at ex::raise (validation.php:545)
at ValidationRunner->_check_error (validation.php:525)
at ValidationRunner->_check (validation.php:510)
at ValidationRunner->check (controller.php:265)
at Controller->_validate (v2.php:3108)
at V2_controller->_add_result (v2.php:3084)
at V2_controller->add_result_for_case (controller.php:257)
at Controller->_invoke_web_call (controller.php:168)
at Controller->_invoke_web (controller.php:120)
at Controller->_invoke (gizmo.php:107)
at require_once (index.php:106)

Thanks
Sathish


#2

First thing I would check is to see if the Version field is required:

If your company does not use the Version field then and it is marked as Required then I would set it to not required and see if it fixes the issue.


#3

Thanks. I am able to post test results after making fields optional or not required.