# Linear new comment notifications on your phone

> Get a push notification when someone comments on a Linear issue.

- Company: Linear (https://www.justpush.io/recipes/linear)
- Event: `Comment` (Comments)
- Tags: Developer tools, Releases
- Install: https://studio.justpush.io/recipes/linear/new-comment
- Web page: https://www.justpush.io/recipes/linear/new-comment

## Setup

1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL.
2. In Linear, go to Settings > API and click New webhook (workspace admins only).
3. Paste your webhook URL (shown in Studio after install) as the URL and pick the team (or all public teams).
4. Tick the Comments resource type and save.
5. Create a webhook under **Settings → API → New webhook** with the URL above, pick the team, and tick **Comments**.
6. Linear signs deliveries with `Linear-Signature` (HMAC-SHA256), but JustPush doesn't check it yet, so keep your endpoint URL private.

## Code

Studio calls `handleRequest(request)` with the incoming webhook (`{ method, headers, body, query, raw }`) and sends the message object it returns. Returning `null` sends nothing.

```js
// Linear → new comment
// Fires when someone comments on an issue in a team your webhook covers.
// Docs: https://linear.app/developers/webhooks

// Keep long text readable in a notification.
function clip(value, max = 120) {
    const text = typeof value === "string" ? value.replace(/\s+/g, " ").trim() : ""
    return text.length > max ? text.slice(0, max - 1) + "…" : text || null
}

// Only link to real http(s) URLs.
function link(url, cta) {
    return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : []
}

function handleRequest(request) {
    const body = request.body || {}
    const data = body.data ?? {}

    // Guard: only new comments.
    if (body.type !== "Comment" || body.action !== "create") {
        console.log(`Ignoring Linear ${body.type ?? "unknown"} ${body.action ?? ""}`)
        return null
    }

    const issue = data.issue ?? {}
    const who = data.user?.name ?? body.actor?.name ?? "Someone"

    return {
        title: `💬 ${who} on ${issue.identifier ?? "an issue"}`,
        message: [clip(data.body) ?? "New comment", issue.title ? `(${issue.title})` : null].filter(Boolean).join(" "),
        topic: "Linear",
        priority: -1, // Low — read it when you're back in Linear
        buttons: link(body.url ?? issue.url, "Open comment"),
    }
}
```

## Linear Comment webhook payload (sample)

```json
{
  "url": "https://linear.app/acme/issue/ENG-123/checkout-total-is-off-by-one-cent#comment-77217de3",
  "data": {
    "id": "77217de3-fb52-4dad-bb9a-b356beb93de8",
    "body": "Found it — we round each line before summing. Fix incoming.",
    "user": {
      "id": "u2",
      "name": "Sam Lee"
    },
    "issue": {
      "id": "2174add1-f7c8-44e3-bbf3-2d60b5ea8bc9",
      "url": "https://linear.app/acme/issue/ENG-123/checkout-total-is-off-by-one-cent",
      "title": "Checkout total is off by one cent",
      "identifier": "ENG-123"
    },
    "edited": false,
    "userId": "u2",
    "issueId": "2174add1-f7c8-44e3-bbf3-2d60b5ea8bc9",
    "createdAt": "2026-09-29T09:05:00.000Z"
  },
  "type": "Comment",
  "actor": {
    "id": "b5ea5f1f-8adc-4f52-b4bd-ab4e84cf51ba",
    "name": "Jane Doe",
    "type": "user",
    "email": "jane@example.com"
  },
  "action": "create",
  "createdAt": "2026-09-29T09:00:00.000Z",
  "webhookId": "000042e3-d123-4980-b49f-8e140eef9329",
  "organizationId": "dc844923-f9a4-40a3-825c-dea7747e57d6",
  "webhookTimestamp": 1790672400000
}
```

## FAQ

### Does this work on iPhone and Android?

Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification.

### Do I need to write code?

No. Install the recipe in Studio, paste your webhook URL into Linear and you are done. The code is there if you want to change the text, the sound or the buttons.

### Can I change what the notification says?

Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save.

### What does it cost?

JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.
