Skip to content

issue list: counts are period-wide, not scoped to the release filter passed in --query #1583

Closed

Description

@Windsland52

Summary

sentry issue list --query 'release:"<release>"' correctly restricts which groups are returned, but the count and userCount in the response are period-wide totals across every release, not the counts matching the query. Nothing in the output signals this, so a release-scoped triage built on issue list silently over-reports by an arbitrary factor.

Environment

sentry 0.40.0
node v24.18.0
Windows 10.0.26200

Steps to reproduce

Any project with several releases contributing to the same issue group.

# 1. list issues restricted to one release
sentry issue list <org>/<project> --period 14d \
  --query 'release:"<release-A>" is:unresolved' \
  --sort freq --limit 100 --fresh --json

# 2. ask the events endpoint for the same group, with the same release filter
sentry api "/organizations/<org>/events/?field=count()&field=count_unique(user)\
&query=issue%3A<SHORT-ID>%20release%3A%22<release-A>%22\
&statsPeriod=14d&project=<project-id>&dataset=errors" --json

Actual

For one group in a project with 21 releases:

source events users
issue list with release:"A" in the query 639 442
events endpoint, same issue + same release 238 189

The issue list numbers equal that group's totals over the period across all releases. The factor is not constant — it depends on how the group is distributed across releases, so it cannot be corrected after the fact.

Expected

Either the counts reflect the applied query filter, or the output marks them as unfiltered lifetime/period totals so a caller does not attribute them to the filter.

Impact

This is the documented path for release triage (references/skill guidance suggests issue list --query 'release:"X" is:unresolved' --sort freq), and it is the natural entry point for agents. In my case it promoted an unrelated high-volume group to "top problem in release X" when that group's actual contribution to the release was a small fraction of the reported number — the release only had ~8k events total while the tool reported a single group at 4118 for it.

Notes

Activity

  1. self-assigned this
    on Sep 3, 2026
  2. added
    jaredTrigger the Jared agent to work on stuff
    on Sep 3, 2026
  3. linear-code commented on Oct 22, 2026

    @linear-code
  4. transferred this issue fromgetsentry/clion Oct 22, 2026
  5. sentry-junior commented on Oct 22, 2026

    @sentry-junior
    Contributor

    Closing — this is fixed on main by #1512 (fix(cli): Scope issue list counts to the release: filter, merged 2026-10-16, 5a7ec5a).

    When --query contains a count-unscoped filter (currently release:), issue list now refetches each listed issue's counts from /organizations/<org>/events/ with issue:<SHORT-ID> plus your query, overwrites count/userCount with the scoped values, and re-ranks the results for --sort freq/--sort user. See applyScopedCounts in packages/cli/src/commands/issue/list.ts and unscopedCountFilterKeys in packages/cli/src/lib/search-query.ts.

    The fix isn't in a published release yet (latest is cli@0.47.0, cut before #1512). It should be in the next CLI release, or you can use a nightly now.

    One limitation: re-ranking applies only to the page that was fetched, because the API still picks that page by period-wide frequency. If you need an exact release-wide top-N, use a larger --limit. If that turns out to matter in practice, please open a separate issue.

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

Metadata

Metadata

Assignees

Labels

jaredTrigger the Jared agent to work on stuff

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions