Skip to content

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

@ryanrozich

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions