Linear Webhook Integration
Collect Linear issue events (via webhooks), transform them to CDEvents.
- Linear notifies a webhook when an issue is created, updated, or removed.
- cdviz-collector transforms these events to
ticketCDEvents, and sends them to the database, listeners,...
| From event | CDEvents |
|---|---|
| Issue / create | ticket.created |
| Issue / update (moved to a closed state) | ticket.closed |
| Issue / update (other) | ticket.updated |
| Issue / remove (issue not closed) | ticket.closed |
Only Issue webhooks are handled. Other types (Comment, Project, Cycle, ...) are ignored.
Configuration
Setting Up cdviz-collector
Configure cdviz-collector.toml to receive Linear webhook events:
[sources.linear_webhook]
enabled = true
transformer_refs = ["linear_webhook"]
[sources.linear_webhook.extractor]
type = "webhook"
id = "000-linear" # used as part of the webhook's url
headers_to_keep = []
[sources.linear_webhook.extractor.headers]
# linear signs with HMAC-SHA256, hex encoded, over the raw body, without prefix
# https://linear.app/developers/webhooks#securing-webhooks
"linear-signature" = { type = "signature", signature_encoding = "hex", signature_on = "body", token = "changeme" }
# Transformer from transformers-community repository
[remote.transformers-community]
type = "github://cdviz-dev/transformers-community"
[transformers]
linear_webhook = { type = "vrl", template_rfile = "transformers-community:///linear_webhook/to_v0_5.vrl" }Replace changeme with the signing secret of the Linear webhook. For more details on remote transformers, see the Transformers documentation.
Setting Up the Linear Webhook
- In Linear: Settings > API > Webhooks > New webhook.
- URL:
https://your-collector-url/webhook/000-linear - Select the Issues data change events.
- Copy the signing secret into the collector config (the
tokenof thelinear-signatureheader).
To verify webhook reception before transformation:
[sources.linear_webhook]
transformer_refs = ["log", "discard_all"] # Log payloads without processingFor webhook troubleshooting, see the Webhook Extractor documentation.
Event Mapping
Event type detection is performed in VRL based on the type and action fields:
Linear type / action | CDEvent Type | Notes |
|---|---|---|
Issue / create | ticket.created | |
Issue / update, state moved to closed | ticket.closed | updatedFrom.stateId set and state.type is closed |
Issue / update, other | ticket.updated | includes edits of an already closed issue |
Issue / remove, issue not closed | ticket.closed | resolution = "withdrawn" |
Issue / remove, issue already closed | (skipped) | ticket.closed was emitted by the earlier update |
A state is closed when state.type is completed or canceled.
Ticket Fields
| CDEvent Field | Linear Source | Notes |
|---|---|---|
subject.id | data.url without the title slug | https://linear.app/<workspace>/issue/<identifier> |
content.summary | data.title | |
content.ticketType | "issue" | Linear has no issue type |
content.priority | data.priorityLabel (lowercased) | no priority, urgent, high, medium, low |
content.assignees | [data.assigneeId] | empty when unassigned |
content.labels | data.labels[].name | |
content.milestone | data.projectMilestone.name | or null |
content.resolution | data.state | completed → completed; canceled named Duplicate → duplicate; other canceled → withdrawn |
customData.linear keeps the webhook envelope (action, type, actor, updatedFrom, ...) and the issue identity (id, identifier, state, team, project, cycle).
Limits
- Do not run with the GraphQL API polling at the same time: both emit
ticket.createdandticket.closedwith different content and timestamps, so each step is stored twice. Use polling to backfill up to a date, then the webhook. - Team move:
subject.iduses the issue identifier (ENG-123). When an issue moves to another team, Linear gives it a new identifier, so later events have a newsubject.id.customData.linear.issue.idstays stable.
The transformer source is linear_webhook/to_v0_5.vrl.