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

[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

Hey,

It seems like this is still an issue, it also seems like this is a regression in 6.1

How are we supposed to be able to a plan_entry if this does not work? Is the documentation up to date?

I’ve tried a hundred different post requests here is the most recent one:

{'entries': [{'name': 'redacted-name', 'config_ids': [1407, 1751, 1753, 1758, 1805], 'suite_id': 1, 'include_all': False, 'case_ids': [13573, 13575, 20456, 13577, 29706, 29707, 13578, 13579, 27409, 20445, 20535, 20536, 13241, 13242, 13243, 13244, 13245, 13246, 13653, 13247, 14179, 14180, 14181, 15722, 15723, 20425, 15725, 28277, 28278, 28279, 28299, 23191, 20393, 20394, 20395, 20396, 20397, 20398, 20399, 20400, 20401, 20402, 20403, 20404, 20405, 20406, 13239, 13240, 20409, 20410, 20411, 22204, 22205, 22206, 22207, 22208, 22209, 20412, 20413, 20415, 20417, 20414, 20416, 20418, 13248, 13249, 20419, 20420, 20421, 20422, 21711, 20423, 20424, 20434, 20426, 20427, 20428, 20429, 20430, 20431, 20432, 20433, 20435, 20436, 20437, 20438, 20439, 20440, 20441, 20442, 20443, 20444, 20446, 20447, 20448, 20449, 20450, 20451, 20452, 20453, 20457, 20458, 20459, 20455, 22257, 20454], 'runs': [{'config_ids': [1407, 1751, 1753, 1758, 1805], 'plan_id': 36785}]}]}

I get the all too familiar config_key error.

Now if I use a different body:

{'name': 'redacted-name', 'config_ids': [1407, 1751, 1753, 1758, 1805], 'suite_id': 1, 'include_all': False, 'case_ids': [13573, 13575, 20456, 13577, 29706, 29707, 13578, 13579, 27409, 20445, 20535, 20536, 13241, 13242, 13243, 13244, 13245, 13246, 13653, 13247, 14179, 14180, 14181, 15722, 15723, 20425, 15725, 28277, 28278, 28279, 28299, 23191, 20393, 20394, 20395, 20396, 20397, 20398, 20399, 20400, 20401, 20402, 20403, 20404, 20405, 20406, 13239, 13240, 20409, 20410, 20411, 22204, 22205, 22206, 22207, 22208, 22209, 20412, 20413, 20415, 20417, 20414, 20416, 20418, 13248, 13249, 20419, 20420, 20421, 20422, 21711, 20423, 20424, 20434, 20426, 20427, 20428, 20429, 20430, 20431, 20432, 20433, 20435, 20436, 20437, 20438, 20439, 20440, 20441, 20442, 20443, 20444, 20446, 20447, 20448, 20449, 20450, 20451, 20452, 20453, 20457, 20458, 20459, 20455, 22257, 20454], 'runs': [{'config_ids': [1407, 1751, 1753, 1758, 1805], 'plan_id': 36785}]}

Then I do not get any error but the run is not updated. In fact every testcase is removed from the run. Is this intended?

What is the timeline for this and until then is there anybody who would be willing to help me with this?

Hi,

Why do we need to enter “config_ids” when update_plan_entry?
Do we have any workaround at the moment? or ETA for the fixed API to release?

This is blocking my software to run properly.