fix(jira): diagnose and fix empty et jira start issue lists - #3
Merged
Conversation
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.
There was a problem hiding this comment.
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
--debugJira 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 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 `: `. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
et jira startreportedNo 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
/rest/api/3/search/jqldoes bounded scanning and may return an emptyissuesarray that still carries anextPageToken._fetch_issue_pagestreated an empty page as the end of the results, silently dropping everything behind it.etnow checks/rest/api/3/myself(which has no anonymous mode) and raises aJiraErrornamingjira.email/jira.pat.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
tests/test_jira.pyfor 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 intests/test_cli.pyfor the--debugflag. Each was written failing first.test_fetch_active_issues_passes_jql_and_basic_authnow asserts against the first request, since an empty result triggers the follow-up credential check.ruff check .andmypy srcclean.nextPageToken, and a 200-empty search paired with a 401 from/myself.🤖 Generated with Claude Code
https://claude.ai/code/session_01DVFbb6evSYs1g8AkU4sLa4