Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'custom_automation_id' #97

Closed
breadberry-prime opened this issue Sep 16, 2022 · 6 comments
Closed

KeyError: 'custom_automation_id' #97

breadberry-prime opened this issue Sep 16, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@breadberry-prime
Copy link

TestRail CLI Version

1.3.0

CLI Environment

3.10.6, MacBookPro

TestRail Version

v7.5.4

TestRail Instance Type

Enterprise Cloud

Current behavior

While trying to upload an auto generated Cypress report the library crashes with 'KeyError: 'custom_automation_id'

Stack:
Traceback (most recent call last): File "/usr/local/bin/trcli", line 8, in <module> sys.exit(cli()) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 84, in new_func return ctx.invoke(f, obj, *args, **kwargs) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/trcli/commands/cmd_parse_junit.py", line 46, in cli result_uploader.upload_results() File "/usr/local/lib/python3.10/site-packages/trcli/api/results_uploader.py", line 92, in upload_results added_test_cases, result_code = self.add_missing_test_cases( File "/usr/local/lib/python3.10/site-packages/trcli/api/results_uploader.py", line 288, in add_missing_test_cases ) = self.api_request_handler.check_missing_test_cases_ids(project_id) File "/usr/local/lib/python3.10/site-packages/trcli/api/api_request_handler.py", line 296, in check_missing_test_cases_ids aut_case_id = case["custom_automation_id"] KeyError: 'custom_automation_id'

This is the cypress Report I used:
TEST-091622.xml.zip

Desired behavior

I would expect that I get a useful error message if the data is wrongly formatted.

More Details

No response

@breadberry-prime breadberry-prime added the bug Something isn't working label Sep 16, 2022
@IPrototypeI
Copy link

Hello I had the same issue you have to apply the custom id to all of your projects in testrail you can check if it works via the API
https://ebike.testrail.net/index.php?/api/v2/get_cases/41&offset=250
use in postman basic authentification to use username and password

@sbhandari40942
Copy link

does anyone has any update on this bug. I am not able to find any workaround

@IPrototypeI
Copy link

IPrototypeI commented Dec 21, 2022

Yes the problem is it is not enough to add a single property to the template you have to apply the property to your project otherwise it is not working and the change is not active on testrail

@d-rede
Copy link
Contributor

d-rede commented Feb 9, 2023

Hello @breadberry-prime , @sbhandari40942 , @IPrototypeI

This should no longer be a problem in trcli v1.4.0. Please give it a try and let me know if it works as you expect it to, thanks!

@vui-le-hpe
Copy link

I can confirm that it works for me in trcli v1.4.2. Earlier I got the following error when trying to run parse_junit:

...
The automation_id field is not properly configured. Please configure it in the TestRail Administration under Customizations > Case Fields.
The field should have the following mandatory details:
  - System Name: automation_id
  - Type: String
  - Is Active: True

I added the field automation_id to Case Fields. It worked after that.

@d-rede
Copy link
Contributor

d-rede commented Feb 22, 2023

Thanks for the feedback @vui-le-hpe !

I will close this issue and a new one can be created in case anyone is running into a similar problem.

@d-rede d-rede closed this as completed Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants