Accept team names and IDs, and state names, wherever the CLI takes them - #279
Merged
Conversation
Every command that takes a team now accepts its key, name, or UUID through
one shared resolver (findTeam / resolveTeam / resolveTeams), replacing the
key-only getTeamIdByKey and the ad-hoc uppercasing spread across commands.
One aliased ResolveTeam operation looks up key, name, and (for UUID-shaped
input) id in a single round trip; precedence is key, then id, then name,
applied client-side so a reference that equals one team's key and another
team's name always means the key. Keys stay the canonical downstream form:
filters that matched on team.key still do, with the server's uppercase key,
and callers that need a UUID take it from the same resolved object. An
unknown team now errors with the list of valid keys instead of an empty
result or a raw "Entity not found" from the API.
Only explicit input goes through the resolver. The configured default team
is already a normalized key, and resolving it would add a round trip to
every default-team invocation of the most-used commands for no gain. In
issue create, the interactive substring picker survives only for that
default; an explicit --team that matches nothing errors like everywhere
else.
issue query --state and issue mine --state take a workflow state name or
ID as well as the six type tokens. Names and IDs are resolved within the
queried scope (the team, the teams, or the whole workspace under
--all-teams, where a name matches every team's same-named state), so a
state from another team errors instead of silently matching nothing, and
the error lists the scope's states. Type-only input still sends the same
{ type: { in } } filter with no extra request; a mix of types and names
becomes an or-filter.
The MCP server already describes these parameters as "key, name, or ID"
and "type, name, or ID"; this brings the CLI to parity so an agent does
not need a preliminary team list to translate a name into a key.
Claude-Session: https://claude.ai/code/session_01A9qEGri4p2HZMQSuYsBmub
This was referenced Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of a three-PR stack (this → #280 → #281), informed by a comparison with Linear's MCP server.
Every command that takes a team now accepts its key, name, or UUID through one shared resolver (
findTeam/resolveTeam/resolveTeams), replacing the key-onlygetTeamIdByKeyand the ad-hoc uppercasing spread across commands. One aliasedResolveTeamoperation looks up key, name, and (for UUID-shaped input) id in a single round trip; precedence is key, then id, then name, so a reference that equals one team's key and another team's name always means the key. An unknown team errors with the list of valid keys instead of an empty result or a raw API error.issue query --stateandissue mine --statealso take a workflow state name or ID in addition to the six type tokens, resolved within the queried scope so a state from another team errors instead of silently matching nothing.Only explicit input goes through the resolver; the configured default team key is already normalized and skips the extra round trip.
Verified: 676 tests (64 old
GetTeamIdByKeymocks rewritten, new unit and command tests), live checks by name, lowercase key, and UUID, a QA case table of 18 cases, and four Codex review passes (two real findings fixed: a--webpath resolving outside the error handler, and a non-advancing pagination cursor).https://claude.ai/code/session_01A9qEGri4p2HZMQSuYsBmub