Skip to content

fix(commands): resolve --assignee to UUID in issues create/update#50

Merged
iamfj merged 3 commits intonextfrom
fix/47-resolve-assignee-id
Feb 20, 2026
Merged

fix(commands): resolve --assignee to UUID in issues create/update#50
iamfj merged 3 commits intonextfrom
fix/47-resolve-assignee-id

Conversation

@iamfj
Copy link
Collaborator

@iamfj iamfj commented Feb 20, 2026

What

Fix for --assignee option on issues create and issues update failing with a GraphQL validation error when given a human-friendly name or email instead of a UUID.

Problem

The --assignee value was passed directly to input.assigneeId without resolution. Every other identifier option (--team, --project, --labels, --cycle, --status, --parent-ticket, --project-milestone) goes through a dedicated resolver, but --assignee was missing one, causing:

{"error": "GraphQL request failed: Argument Validation Error - assigneeId must be a UUID."}

Solution

  • Added resolveUserId() resolver (src/resolvers/user-resolver.ts) using LinearSdkClient, following the established resolver pattern
  • Lookup order: UUID passthrough → display name (case-insensitive) → email (case-insensitive)
  • Handles multipleMatchesError when name is ambiguous, notFoundError when no match exists
  • Wired resolver into both issues create and issues update commands

Testing

  • 5 resolver unit tests: UUID passthrough, name lookup, email fallback, not-found error, multiple-matches error
  • 5 command-level integration tests: verify resolveUserId is called with correct args and its UUID flows into createIssue/updateIssue for both name and email inputs, plus omitted-assignee cases
  • All 143 tests passing, build clean

Checklist

  • Bug resolved
  • Regression tests added
  • No side effects introduced

Closes #47

iamfj and others added 3 commits February 20, 2026 11:40
Resolves user identifiers (display name, email, or UUID) to UUIDs via
the Linear SDK, following the same pattern as existing resolvers.

Lookup order: UUID passthrough → display name (case-insensitive) →
email (case-insensitive). Throws multipleMatchesError when name is
ambiguous, notFoundError when no match exists.

Closes #47

Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
The --assignee option was passed directly to assigneeId without
resolution, causing GraphQL validation errors when given a name or
email instead of a UUID. Wire both create and update through the new
resolveUserId resolver.

Closes #47

Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
Add command-level tests that drive the CLI through Commander and
verify resolveUserId is called with the correct input and its result
flows into the service layer. Covers create with name, create with
email, update with name, and omitted-assignee cases.

Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
@iamfj iamfj added the bug Something isn't working label Feb 20, 2026
@iamfj iamfj self-assigned this Feb 20, 2026
@iamfj iamfj merged commit 64dfac1 into next Feb 20, 2026
2 checks passed
@iamfj iamfj mentioned this pull request Feb 20, 2026
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments