Skip to content

TR-21906: Display AI automated and generated fields for cases list and get commands - #470

Open
acuanico-tr-galt wants to merge 2 commits into
feature/TR-22028from
feature/TR-21906
Open

acuanico-tr-galt wants to merge 2 commits into
feature/TR-22028from
feature/TR-21906

Conversation

@acuanico-tr-galt

Copy link
Copy Markdown
Contributor

Solution description

Implemented display of the new TestRail API fields is_ai_generated / is_ai_automated in the trcli cases get and trcli cases list commands.

Changes

trcli/commands/cmd_cases.py:

  • get() compact mode: added AI Generated: Yes/No and AI Automated: Yes/No lines right after Priority ID (trcli/commands/cmd_cases.py:86-87)
  • list() compact mode: added the same two lines per case, after Type ID (trcli/commands/cmd_cases.py:270-271)
  • list()'s --show-all-fields generic field loop: added a bool branch so any boolean field (including the new AI fields) renders as Yes/No instead of raw True/False (trcli/commands/cmd_cases.py:244-245)

Also updated README sample output and test_cmd_cases.py for unit tests.

Potential impacts

None.

Steps to test

See Readme Cases Get and List command: 1497 - 1673

PR Tasks

  • PR reference added to issue
  • README updated
  • Unit tests added/updated


environment.log(f" Priority ID: {case.get('priority_id', 'N/A')}")
environment.log(f" Type ID: {case.get('type_id', 'N/A')}")
environment.log(f" AI Generated: {'Yes' if case.get('is_ai_generated') else 'No'}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the compact list output, optional fields like refs, labels, and milestone_id are shown conditionally — only when they have a value. But the AI fields are shown unconditionally for every case, even when both are False/absent. If a project never uses AI generation, every case output will have two lines of "No". Is this intentional?

Comment thread tests/test_cmd_cases.py
mock_client.api_request_handler.case_handler.get_cases.assert_called_once_with(
project_id=99, suite_id=None, priority_id=None, filter_text=None, limit=250, offset=0
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test: get --show-all-fields boolean formatting

The elif isinstance(value, bool) branch in the get() show-all-fields code path (lines 126–127) has no test. test_list_cases_show_all_fields_bool_formatting covers the equivalent branch in list, but the get --show-all-fields branch is completely untested. A test analogous to test_list_cases_show_all_fields_bool_formatting but invoking cmd_cases.get with ["--case-id", "123", "--show-all-fields"] is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants