Skip to content

Support all six document attachment targets in document create/update/list/view - #262

Merged
schpetbot merged 2 commits into
mainfrom
schpet/push-mvuoylppukyl
Aug 11, 2026
Merged

Support all six document attachment targets in document create/update/list/view#262
schpetbot merged 2 commits into
mainfrom
schpet/push-mvuoylppukyl

Conversation

@schpetbot

Copy link
Copy Markdown
Collaborator

Linear attaches every document to exactly one target — project, issue, initiative, team, cycle, or release — and documentCreate now rejects targetless documents outright. The CLI only exposed --project/--issue on create, --project on update, and slug-only --project plus --issue on list.

This goes beyond the literal report (create flags) to make attachment support consistent everywhere, per the six-target model:

  • Shared attachment-target module backing create, update, and list: six long-only flags, client-side exactly-one validation before any network/editor/stdin work (errors name CLI flags, not GraphQL fields), and --team + --cycle collapsing into one team-scoped cycle target, matching the issue commands.
  • create gains --initiative, --team, --cycle, --release; the interactive "Nothing (workspace document)" option is removed (it always fails server-side now) and the prompt offers all six targets.
  • update gains all target flags including the previously missing --issue; a target flag re-points the document (the server clears the old target).
  • list gains the same filters, resolved to relation IDs — this also fixes --project silently matching slug IDs only, and makes invalid filter input error instead of returning an empty list. The ATTACHMENT column now labels the target type (Team: Linear CLI (CLI), Cycle: CLI #2 — Polish sprint, …).
  • view selects and renders all six associations; --json output keeps GraphQL field names/nesting.
  • New shared resolvers: resolveInitiativeId (UUID/slug/name) and resolveReleaseId (UUID/name/version, paginated to exhaustion) — both reject ambiguous matches with a candidate listing instead of picking one silently.
  • First commit is a sync-schema refresh: the vendored schema predated releaseId/cycleId on the document inputs, ReleaseFilter, and Document.cycle/Document.release.

Notes:

  • teamId/initiativeId/cycleId are marked [Internal] in Linear's schema but verified working with a regular API key (as issueId was before it became public); failures would surface cleanly through the existing error handling.
  • Live-QA'd against a real workspace for project/issue/team/cycle/initiative targets including re-pointing. Release attachment is covered by mocked tests and the refreshed schema only — releases require a Business plan, which the QA workspace doesn't have.

Fixes #260

schpet added 2 commits August 11, 2026 13:31
Refresh the vendored schema from live introspection. Notably picks up
releaseId/cycleId on DocumentCreateInput/DocumentUpdateInput, the
team/cycle/release relations on DocumentFilter, Document.cycle and
Document.release, and ReleaseFilter — prerequisites for document
attachment-target support.
Linear attaches every document to exactly one target — project, issue,
initiative, team, cycle, or release — and documentCreate now rejects
targetless documents outright. The CLI only exposed --project/--issue on
create, --project on update, and slug-only --project plus --issue on list.

The reporter asked for the missing create flags; the consistent fix is
wider: a shared attachment-target module (six long-only flags, exactly-one
validation before any network/editor/stdin work, --team + --cycle
collapsing into one team-scoped cycle target like the issue commands)
now backs create, update, and list, so their semantics cannot drift.
Along the way this removes the interactive "workspace document" option
(it always fails server-side now), gives update the missing --issue,
fixes list --project silently matching slug IDs only, resolves list
filters to IDs so bad input errors instead of returning an empty list,
types the ATTACHMENT column (six namespaces make bare names ambiguous),
and shows all six associations in view/list output.

New shared resolvers: resolveInitiativeId (UUID/slug/name) and
resolveReleaseId (UUID/name/version, paginated to exhaustion so ambiguity
detection sees every candidate, erroring on ambiguous matches rather than
picking one silently). teamId/initiativeId/cycleId are [Internal] in
Linear's schema but verified working with a regular API key, as issueId
was before it became public.

Live-QA'd against a real workspace for project/issue/team/cycle/
initiative targets, including re-pointing (the server clears the old
target). Releases require a Business plan and are covered by mocked
tests and the refreshed schema only.

Github-Issue: Fixes #260
Github-Issue-Url: #260
@schpetbot
schpetbot merged commit 928b1eb into main Aug 11, 2026
15 checks passed
@schpetbot
schpetbot deleted the schpet/push-mvuoylppukyl branch August 11, 2026 21:32
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.

Attaching documents to teams, initiatives, releases, and cycles

2 participants