Skip to content

Fix lookupUserId to handle 'self' keyword#104

Merged
schpet merged 2 commits into
schpet:mainfrom
JustTrott:fix/lookup-user-id-self
Jan 27, 2026
Merged

Fix lookupUserId to handle 'self' keyword#104
schpet merged 2 commits into
schpet:mainfrom
JustTrott:fix/lookup-user-id-self

Conversation

@JustTrott

Copy link
Copy Markdown
Contributor

Problem

--assignee self fails with:

Could not determine user ID for assignee self

Root Cause

The code in issue-create.ts uses "self" as the keyword for auto-assigning to the current user (lines 184, 389, 648), but lookupUserId() only checks for "@me".

When "self" is passed, it falls through to the user search query which looks for a user literally named "self" - which doesn't exist.

Fix

Add "self" as an alias alongside "@me" in lookupUserId():

if (input === "@me" || input === "self") {

Now both --assignee self and --assignee @me work correctly.

The code in issue-create.ts uses 'self' as the keyword for
auto-assigning to the current user, but lookupUserId() only
checked for '@me'. This caused '--assignee self' to fail with
'Could not determine user ID for assignee self'.

Now both 'self' and '@me' resolve to the current viewer.
Now that 'self' resolves via GetViewerId instead of LookupUser,
update the test mocks accordingly.
@schpet

schpet commented Jan 27, 2026

Copy link
Copy Markdown
Owner

seems reasonable, i'm ok with someone using self as a username being out of luck 😄

@schpet schpet merged commit ab13420 into schpet:main Jan 27, 2026
7 checks passed
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