Skip to content

fix(jira): bound the All filter JQL for Jira Cloud search - #23645

Closed
ggbdpq wants to merge 2 commits into
stablyai:mainfrom
ggbdpq:fix/jira-cloud-unbounded-jql
Closed

ggbdpq wants to merge 2 commits into
stablyai:mainfrom
ggbdpq:fix/jira-cloud-unbounded-jql

Conversation

@ggbdpq

@ggbdpq ggbdpq commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

ELI5

On Jira Cloud, selecting the All filter in the Jira task list failed with an "Unbounded JQL queries are not allowed here" error. Jira Cloud refuses search queries that carry no restricting clause, and All was the only filter that sent one. All now adds an "updated in the last 90 days" restriction when talking to a Cloud site, so the filter works again.

What Changed

  • The All filter's JQL (resolution = Unresolved ORDER BY updated DESC) is now sent as resolution = Unresolved AND updated >= -90d ORDER BY updated DESC when the target site is Jira Cloud, via a new jqlForSite() helper applied per site in searchIssues (src/main/jira/jira-issue-search.ts).
  • Jira Server/DC still receives the original unbounded JQL (its classic /search endpoint accepts it), and caller-provided JQL strings pass through untouched on every site type.
  • Added three unit tests: Cloud All gets the bound, Server All stays unbounded, caller-provided JQL untouched.

Why

Jira Cloud's /rest/api/3/search/jql endpoint rejects unbounded queries with a 400, so the All filter was broken on every Cloud site. The Assigned, Reported, and Done filters restrict on currentUser() and were unaffected. Of the alternatives raised in the issue — bounding by the user's selected projects (needs a new project-mapping feature) or hiding All on Cloud sites — a recency bound is the smallest change that makes All work today without new settings or UI behavior changes.

Linked Issue

Fixes #23617

Visual Proof

N/A — no UI change; the fix is a request-payload difference that restores the existing All filter on Cloud sites.

Testing

Check Result
vitest run src/main/jira/issues.test.ts 33/33 passed (incl. 3 new tests)
vitest run src/main/jira/ (directory) 96/96 passed
pnpm typecheck pass (exit 0, no errors)
oxlint on the two changed files 0 warnings, 0 errors

Verified with automated tests only; no live Jira Cloud instance was available locally, so the 400 reproduction comes from the issue report. The full pnpm lint / pnpm test / pnpm build suite was not run locally — CI will cover it.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

AI Disclosure

Implementation and this PR description were drafted with GLM-5.3-Flash (ZCode) coding-agent assistance under human direction and review.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No security, cross-platform (Linux/Windows/macOS), remote SSH, mobile, backwards-compatibility, or performance impact expected: the change only alters the JQL payload for the All filter on Jira Cloud sites.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Jira Cloud's /rest/api/3/search/jql endpoint rejects unbounded queries,
so selecting the All filter on a Cloud site failed with
"Unbounded JQL queries are not allowed here" (stablyai#23617). The Assigned,
Reported, and Done filters restrict on currentUser() and were unaffected.

The All filter's JQL is now given an updated >= -90d bound when sent to
Cloud sites; Server/DC's classic /search still accepts unbounded queries
and keeps the original JQL, as do caller-provided JQL strings.

Fixes: stablyai#23617
Generated-by: GLM-5.3-Flash (ZCode)
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 7cf7ab1b-280d-4b22-ba4f-85c87941afdb

📥 Commits

Reviewing files that changed from the base of the PR and between 9947713 and 1a6288e.

📒 Files selected for processing (2)
  • src/main/jira/issues.test.ts
  • src/main/jira/jira-issue-search.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/jira/issues.test.ts
  • src/main/jira/jira-issue-search.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The “all” filter adds an updated >= -90d restriction for non-Server Jira sites. Server/DC keeps the unrestricted unresolved-issues query. Caller-provided JQL remains unchanged. Tests cover all three cases.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 1a628

The Jira Cloud All filter is bounded without changing Server/DC searches or custom queries. No actionable merge-blocking risk remains after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 99477

Jira Cloud’s All filter is narrowed to recent issues without changing site access or credentials. An identical custom query is also narrowed, however, despite the intended custom-query behavior.

Retained concerns

  • Low · architecture · inferred: On non-Server sites, a caller-provided query identical to the built-in All JQL is silently given the 90-day bound. The custom-query test does not cover that case.
Security review details

Security Blast Radius

  • inferred — The changed query text is sent to already-selected Jira sites using their existing per-site credentials; the change does not itself add a site, credential, or request destination.

Trust Boundaries and Controls

  • observed — Caller JQL reaches the existing authenticated Jira request path. The new transformation changes query content, not the function that applies authorization or selects the destination URL.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR satisfies the unbounded Jira Cloud All-filter objective in [#23617]. listIssues('all') passes an explicit bound flag, and Cloud requests use updated >= -90d; Server/DC requests and caller-p… Implement the per-repository Jira project mapping, project scoping, and related issue-based worktree behavior requested in [#23617], or move those requirements to a separate linked issue before treating the issue requirements as complete.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: bounding the Jira Cloud All-filter JQL.
Description check ✅ Passed The description follows the required template and explains the user impact, implementation, rationale, linked issue, testing, AI disclosure, and compatibility considerations. It also explains that no …
Out of Scope Changes check ✅ Passed The production changes and tests stay within the Jira scope of [#23617]. They bound only the built-in All-filter query for Jira Cloud and verify the required Server/DC and caller-provided JQL behavior…
Full details: Linked Issues check

Explanation

The PR satisfies the unbounded Jira Cloud All-filter objective in [#23617]. listIssues('all') passes an explicit bound flag, and Cloud requests use updated >= -90d; Server/DC requests and caller-provided JQL remain unchanged. Tests cover these cases. However, [#23617] also requests per-repository Jira project mapping, repository project scoping, and related issue-based worktree behavior. The reviewed changes do not implement those coding requirements.

  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 065afd62-a4c5-44b0-b6de-203517cfcde4

📥 Commits

Reviewing files that changed from the base of the PR and between aedb930 and 9947713.

📒 Files selected for processing (2)
  • src/main/jira/issues.test.ts
  • src/main/jira/jira-issue-search.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread src/main/jira/jira-issue-search.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

  • Per-site JQL bound for the All filter — searchIssues now routes the All filter's JQL through the new jqlForSite, which swaps in resolution = Unresolved AND updated >= -90d ORDER BY updated DESC when the target site's authType !== 'server'. Server/DC keeps the unbounded query on classic /search.
  • Caller JQL and other filters untouched — filterToJql('all') returns the shared ALL_ISSUES_JQL constant, and jqlForSite only rewrites that exact string, so Assigned/Reported/Done and caller-provided JQL pass through unchanged.
  • Three focused unit tests — Cloud All gets the bound, Server All stays unbounded, and a caller-provided JQL string is not rewritten. All 33 tests in issues.test.ts pass and oxlint is clean on both changed files.

The bound covers every entry point (listIssues, IPC, runtime-jira-commands) since they all funnel through searchIssues. The 90-day truncation of All on Cloud is the tradeoff the linked issue explicitly accepted, so no concern there. No live Cloud reproduction was possible, but the test assertions would fail without the new helper, so the coverage is real.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…JQL text

CodeRabbit review follow-up: the string-equality check could not tell the
All filter's JQL from a caller-provided searchIssues string that happens
to be identical, and would have added the 90-day bound to the latter.
searchIssues now takes an explicit boundAllForCloud flag that only
listIssues('all') sets, so caller-provided JQL is never rewritten.

Regression test added: caller passing the exact All filter string to a
Cloud site stays untouched.
@ggbdpq

ggbdpq commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in 1a6288e: searchIssues now takes an explicit boundAllForCloud flag that only listIssues('all') sets — the bound can no longer reach caller-provided JQL, even when it is byte-identical to the All filter string. Regression test added (does not rewrite caller-provided JQL that equals the All filter string); 34/34 in issues.test.ts, typecheck and oxlint clean.

@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Changes how the all-issues filter queries Jira Cloud.

This should not merge until the Cloud “All Open” preset’s exclusion of older unresolved issues is addressed or made explicit.

Findings

  1. P1 Older open issues disappear ▶

Summary

The PR bounds the Jira Cloud “All Open” search to issues updated in the last 90 days while retaining the original query for Server/DC and caller-provided JQL.

  • Adds tests for Cloud, Server/DC, and caller-provided query payloads.
  • The Cloud preset no longer includes older unresolved issues despite its “All Open” label.

Reviews (1) · Last reviewed commit: "fix(jira): pass the All filter origin ex..."

Comment thread src/main/jira/jira-issue-search.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

Reviewed the delta since the prior pullfrog review (9947713): commit 1a6288e replaces JQL-text matching with an explicit filter-origin flag. Everything below is grounded in the current head (1a6288e).

  • Explicit All-filter origin — listIssues now passes filter === 'all' as a new searchIssues argument, which threads boundAllForCloud down to jqlForSite; the Cloud recency bound is no longer inferred from the JQL string.
  • Caller JQL preserved by construction — direct searchIssues callers default boundAllForCloud to false, so a caller-provided JQL that happens to equal the All-filter string reaches Jira unwritten.
  • Regression test added — a unit test drives searchIssues with resolution = Unresolved ORDER BY updated DESC and asserts Jira receives it unchanged; it fails against the old string-equality matcher.

Verified locally: vitest run src/main/jira/issues.test.ts → 34 passing, oxlint on both changed files → 0 warnings/0 errors, and check-max-lines-ratchet → OK.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@ggbdpq

ggbdpq commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

Fair concern — noted as a deliberate tradeoff rather than an oversight. The unbounded query is rejected outright by Jira Cloud (the 400 in #23617), so the alternatives are "all open issues visible, feature broken" vs "last 90 days visible, feature working". The 90-day window is one of the bounds suggested in the issue itself; the complete fix (per-repository project mapping so the query is bounded by project instead of by date) is the feature-request half of #23617 and needs a maintainer decision on UX shape. Happy to switch the bound or implement the project mapping if maintainers prefer.

@ggbdpq

ggbdpq commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Friendly ping — this has been open for a few days without a reviewer look yet. Happy to adjust anything or provide more detail if useful. Thanks!

nwparker added a commit that referenced this pull request Oct 14, 2026
Reference the Cloud unbounded-query investigation in #23645 while preserving older open work with project restrictions.

Co-authored-by: ggbdpq <[email protected]>
@ggbdpq

ggbdpq commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @nwparker for taking the Cloud All diagnosis forward in #28579, with the commit credit included — much appreciated. The project-bounded search with per-batch project IDs is the better shape: as the PR body lays out, a 90-day recency cutoff makes the 400 disappear by hiding older open tickets, and the full project discovery preserves exactly the work this PR's window would have hidden. Closing this PR in favor of #28579.

@ggbdpq ggbdpq closed this Oct 25, 2026
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.

Jira: 'All' filter fails on Jira Cloud (unbounded JQL); request per-repo Jira project mapping

1 participant