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

[API] Error - Undefined variable: config_key

Hi,

After the latest update (cloud version), I started to get an error when I’m trying to update the results via API.

Rest client ex: 500 - {“error”:“Undefined variable: config_key”}, request body: TestPlanEntry(id=996d98bf-758c-4f63-9ab7-e356e5e227c9, suite_id=14, name=igor, case_ids=[131456, 292865, 292994, 4038, 4039, 375757, 375629, 375628, 193608, 3530, 4042, 231496, 193609, 4043, 4044, 4045, 375637, 33880, 375711, 231512, 375705, 375704, 375706, 4130, 375712, 375714, 375522, 4136, 4267, 193580, 193585, 1524, 292912, 375410, 375547, 193596, 292923], include_all=false, runs=, config_ids=, milestone_id=null)

Could anyone take a look and help to determine the problem?

Hi Igor,

Thanks for the post and error report! We have identified that TestRail’s API does not return the appropriate error code in specific uses of ‘update_plan_entry’.

This error message would likely arise in these situations:

  • You are submitting a config_ids array with update_plan_entry while the entry itself does not use configurations.

  • Or, you are omitting the config_ids array with update_plan_entry while the entry does use configurations.

Can you let me know if either of these situations apply to the data you are submitting? Omitting or including the config_ids array where appropriate should resolve the error message. We are also working on a fix to this error and will release the fix as soon as it is available.

If these situations do not apply to you, can you email us at contact@gurock.com with the output of get_plan for this test plan along with the full POST body you are submitting?

Thanks,
Jon

1 Like

I have the same issue
POST http://testrail.dev/index.php?/api/v2/update_plan_entry/20250/93755b53-e704-4149-a760-81905b64fd67
Body
{
“description”:“Link to report in Allure: http://xxx.local:8080/job/TestRailRun/4367/allure
}

Have same issue too while adding new cases. However, provided same config_ids as for add_new_entry call helped. But:

  1. documentation is not up to date
  2. there is no config_ids in entry description of plan details. need to calculate them from run list each time