Skip to content

Cannot filter for issues with 'Done' (completed) status: issues list --status Done always returns zero results #179

Closed

Description

@ryanrozich

What happened?

When using the status filter (e.g., --status Done) with the CLI command linearis issues list, the command returns zero results even though there are issues in that status. There is no error or warning, and the same issue in other statuses works as expected.


Root cause / code analysis

The implementation always applies an implicit filter excluding issues with status type 'completed', even when the user passes an explicit status filter, which causes logical contradiction and zero results.

Current code (src/services/issue-service.ts):

const NON_COMPLETED_ISSUES_FILTER: IssueFilter = {
  state: { type: { neq: "completed" } },
};

function buildListIssuesFilter(filter: IssueFilter): IssueFilter {
  return {
    and: [NON_COMPLETED_ISSUES_FILTER, filter],
  };
}

So when a user runs:

linearis issues list --team ADV --status Done

The resulting filter is (pseudocode):

{
  and: [
    { state: { type: { neq: "completed" } } },
    { state: { id: { in: ["<done-status-id>"] } } }
  ]
}

If the "Done" status has type: "completed", this filter always excludes it, so no issues return.

Proposed fix

Only apply the implicit "not completed" filter if the user did NOT supply any explicit status filter:

function buildListIssuesFilter(filter: IssueFilter): IssueFilter {
  if (filter.state) return filter; // let user be explicit
  return {
    and: [NON_COMPLETED_ISSUES_FILTER, filter],
  };
}

This would let users actually retrieve issues in a completed state using the status filter. The current behavior is not documented but is a significant principle-of-least-surprise violation.

Expected behavior

I expect to be able to filter issues by any status, including ones that are 'completed.' When I filter with --status Done (or other completed type), all issues in that status should appear in the results, just like any other status.

Steps to reproduce

1. Change at least one issue to the 'Done' status for a team
2. Run: `linearis issues list --team <TEAM_NAME> --status Done`
3. Observe zero results, even though there are issues in that status
4. Run: `linearis issues list --team <TEAM_NAME>`
5. Notice that issues in 'Done' status do not appear, but issues in other statuses do.

Actual output

No error message. The JSON result has an empty nodes array. For example:

{
  "nodes": [],
  "pageInfo": {
    "hasNextPage": false,
    "endCursor": null
  }
}

Linearis version

2026.4.8

Node.js version

v25.8.2

Operating system

macOS

Authentication method

No response

Additional context

Advanced troubleshooting reveals that the CLI implementation always applies an implicit filter excluding issues with status type 'completed' (see NON_COMPLETED_ISSUES_FILTER in the code). This silent filter remains even when an explicit status filter is used, which creates a logical contradiction and results in zero results for completed statuses like 'Done'.

This behavior is not documented anywhere, and it's not possible to retrieve completed issues using the CLI. Either the implicit filter should be removed when an explicit status is provided, or the documentation/process should be updated so this is clear to users.


Related files:

  • src/services/issue-service.ts (where NON_COMPLETED_ISSUES_FILTER and buildListIssuesFilter are defined)
  • No mention in documentation or CLI reference of this implicit filter.

Activity

  1. linear commented on Apr 24, 2026

    @linear
  2. added theissue type on Apr 24, 2026
  3. added
    priority:P2Important work, but not part of the immediate implementation queue
    and removed
    bugSomething isn't working
    on Apr 24, 2026
  4. iamfj commented on Apr 24, 2026

    @iamfj
    Member

    Hey @ryanrozich! Thanks for reporting this — and for the detailed analysis. You were right about the contradiction.

    We’ve now implemented a fix in PR #180

    What changed

    • issues list still excludes completed issues by default (existing behavior).
    • But when an explicit completion-related filter is provided (for example --status Done or completed-date filters), we now honor that explicit filter instead of injecting the implicit state.type != completed condition.
    • We also added regression tests to make sure this behavior doesn’t regress.

    Could you verify on the pre-release?

    When you have a moment, could you please test this in the pre-release (see here how to install the pre-release channel) build from #180 and confirm whether your case now works (issues list --team <TEAM> --status Done)?

    If it still fails, please share:

    1. exact command used
    2. output JSON
    3. linearis + Node versions

    Also, while we expected this behavior to be the most intuitive interface, this issue is a good signal that the current UX may still be confusing. If you have ideas for making this command behavior clearer or more intuitive, we’d really value your suggestions.

    Thanks again for the high-quality report.

  5. ryanrozich commented on Apr 26, 2026

    @ryanrozich
    ContributorAuthor

    Absolutely @iamfj! Thanks for fixing it, I just verified using the pre-release and it works. Nice job

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomerspriority:P2Important work, but not part of the immediate implementation queue

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions