Skip to content

feat(issue): add interactive issue assign command - #140

Merged
bougyman merged 3 commits into
mainfrom
CRY-54-interactive-issue-assign
Aug 18, 2026
Merged

feat(issue): add interactive issue assign command#140
bougyman merged 3 commits into
mainfrom
CRY-54-interactive-issue-assign

Conversation

@bougyman

Copy link
Copy Markdown
Member

Summary

  • Adds lc issue assign <issue-id> — assigns an issue to any team member, not just self (which issue take already handles)
  • Fetches assignable members from the issue's resolved team via team.members GraphQL query (confirmed in schema)
  • Follows the issue status pattern exactly: --assignee/-a flag for non-interactive use, Prompt.select/2 when omitted
  • Name resolution: case-insensitive exact match, then unique prefix match (same algorithm as workflow state resolution)
  • Alias: lc issue a CRY-1 routes to issue assign

Changes

  • app/lib/linear_cli/linear/user.ex: New User.Read.ByTeam manual read action + :by_team action declaration
  • app/lib/linear_cli/linear.ex: Linear.team_members/1 domain code interface
  • app/lib/linear_cli/cli/commands.ex: Commands.issue_assign/1 command function with member resolution helpers
  • app/lib/linear_cli/cli.ex: Optimus spec, dispatch clause, "a" alias

Test plan

  • --assignee exact name match (case-insensitive)
  • --assignee unique prefix match
  • --assignee unknown name → exits 22 with "smells bad" message
  • --assignee ambiguous prefix → exits 22 with "smells bad" message
  • Interactive selection (no --assignee) prompts sorted member list
  • --output json emits structured issue output
  • Alias a routes to issue assign
  • No assignable members → exits 22 with "smells bad" message
  • All 262 tests pass (6 pre-existing LinearCli.GitTest failures unrelated to this change)

Closes: https://linear.app/cryptokairos/issue/CRY-54/add-an-interactive-issue-assign-command

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings August 18, 2026 13:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread app/lib/linear_cli/linear/user.ex Outdated
@bougyman

Copy link
Copy Markdown
Member Author

Addressed the inline review comment on User.Read.ByTeam: replaced the case with with/when in f6e9e80.

with {:ok, %{"team" => team}} when is_map(team) <- Api.call(document, %{"id" => team_id}),
     %{"members" => %{"nodes" => nodes}} <- team do
  {:ok, Enum.map(nodes, &User.from_map/1)}
else
  {:ok, _} -> {:ok, []}
  error -> error
end

The when is_map(team) guard distinguishes a nil team from a populated one without needing a case.

bougyman and others added 3 commits August 18, 2026 10:22
Add `lc issue assign <issue-id>` to assign an issue to any team member,
not just the current user (which `issue take` already handles).

- User.Read.ByTeam: new manual read action fetching team members via
  `team(id:) { members(first: 50) { nodes { ... } } }` GraphQL query
- Linear.team_members/1: new domain code interface
- Commands.issue_assign/1: resolves issue, fetches team members, resolves
  target via --assignee flag (exact then prefix match) or Prompt.select/2,
  then calls Linear.assign_issue/2 and displays the result
- Optimus spec for `assign` subcommand with --assignee/-a option
- Dispatch clause and "a" alias under issue subcommands
- 14 new tests: flag-based, prefix match, ambiguous/unknown errors,
  interactive selection, JSON output, alias routing, empty-members guard

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bougyman
bougyman force-pushed the CRY-54-interactive-issue-assign branch from bcb3d13 to 96e272c Compare August 18, 2026 14:22
@bougyman
bougyman merged commit 33176bd into main Aug 18, 2026
2 checks passed
@bougyman
bougyman deleted the CRY-54-interactive-issue-assign branch August 18, 2026 14:23
bougyman pushed a commit that referenced this pull request Aug 18, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.14.0](v1.13.2...v1.14.0)
(2026-08-18)


### Features

* **issue:** add --description option to lc issue update
([#141](#141))
([d762f32](d762f32))
* **issue:** add interactive issue assign command
([#140](#140))
([33176bd](33176bd))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

2 participants