Skip to content

fix(jira): diagnose and fix empty et jira start issue lists - #3

Merged
seb4stien merged 3 commits into
seb4stien:mainfrom
cbartz:fix/jira-empty-issue-list
Aug 17, 2026
Merged

fix(jira): diagnose and fix empty et jira start issue lists#3
seb4stien merged 3 commits into
seb4stien:mainfrom
cbartz:fix/jira-empty-issue-list

Conversation

@cbartz

@cbartz cbartz commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

et jira start reported No active Jira issues available to start a task from. for a JQL that returned issues in the Jira web UI. Diagnosing it turned up one real bug, one latent one, and a gap in what the CLI is willing to tell you.

Changes

  • fix: follow pagination past empty result pages. Jira Cloud's /rest/api/3/search/jql does bounded scanning and may return an empty issues array that still carries a nextPageToken. _fetch_issue_pages treated an empty page as the end of the results, silently dropping everything behind it.
  • fix: report rejected credentials instead of an empty issue list. Jira serves a search whose Basic credentials it can't use anonymously — HTTP 200 with no issues — rather than refusing it. An expired or truncated API token therefore looked exactly like "you have no open issues". When a search comes back empty, et now checks /rest/api/3/myself (which has no anonymous mode) and raises a JiraError naming jira.email/jira.pat.
  • feat: et --debug. Logs each Jira search request (URL, exact JQL sent, authenticating account) and the issue keys each page returns. The token is never logged. This is what separated "Jira returned nothing" from "the issues were filtered out as already linked to a workspace" during the investigation.

The credential check costs one extra request, and only when a search returns zero issues.

Test plan

  • Three new tests in tests/test_jira.py for the credential check (401 raises, 200 returns empty, non-empty search skips the check), plus tests for empty-page pagination and the debug logging; one in tests/test_cli.py for the --debug flag. Each was written failing first.
  • test_fetch_active_issues_passes_jql_and_basic_auth now asserts against the first request, since an empty result triggers the follow-up credential check.
  • Full suite: 278 passed, coverage 89.6%; ruff check . and mypy src clean.
  • Verified end to end against a local mock Jira reproducing both failure shapes — an empty first page carrying a nextPageToken, and a 200-empty search paired with a 401 from /myself.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DVFbb6evSYs1g8AkU4sLa4

cbartz added 3 commits August 14, 2026 14:47
Jira Cloud's /rest/api/3/search/jql endpoint does bounded scanning and can
return an empty issues array that still carries a nextPageToken. The fetch
loop treated an empty page as the end of the results, so a JQL that matches
issues in the Jira UI could yield nothing and make 'et jira start' report
'No active Jira issues available to start a task from.'
Diagnosing an empty 'et jira start' issue list required hand-written probe
scripts, since the CLI shows neither the JQL it sends, the account it
authenticates as, nor what each page of results returns. --debug switches
the root logger to DEBUG and logs all three.
Jira serves a search request with unusable Basic credentials anonymously
(HTTP 200 with no issues) rather than refusing it, so an expired or
truncated API token surfaced as 'No active Jira issues available to start a
task from.' Verify the credentials against /rest/api/3/myself when a search
comes back empty, and raise a JiraError naming jira.email/jira.pat.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Improves Jira issue retrieval diagnostics and handling of empty results.

Changes:

  • Continues pagination through empty Jira pages.
  • Validates credentials when searches return no issues.
  • Adds --debug Jira request logging and documentation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/et/jira.py Fixes pagination, credential checks, and debug logging.
src/et/cli.py Adds the global --debug option.
tests/test_jira.py Tests Jira fixes and diagnostics.
tests/test_cli.py Tests debug logging activation.
README.md Documents troubleshooting and credential behavior.
CHANGELOG.md Records the new features and fixes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md
Comment on lines +235 to +237
The `jql` value is a plain YAML scalar, so quoting it is optional — quote
it only if it starts with a character YAML reserves (`{`, `[`, `*`, `&`,
`!`, `%`, `@`) or contains ` #` or `: `.
@seb4stien
seb4stien merged commit 6b82f2a into seb4stien:main Aug 17, 2026
1 check passed
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.

3 participants