# Linear issue assigned notifications on your phone

> Get a push notification when a Linear issue is assigned, optionally only when it's assigned to you.

- Company: Linear (https://www.justpush.io/recipes/linear)
- Event: `Issue` (Issues)
- Tags: Developer tools, Releases
- Install: https://studio.justpush.io/recipes/linear/issue-assigned
- Web page: https://www.justpush.io/recipes/linear/issue-assigned

## 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 Issues resource type and save.
5. Create a webhook under **Settings → API → New webhook**, pick the team, and tick **Issues**. To only hear about issues assigned to **you**, add your email (or name) to the URL:
6. ```
7. your webhook URL (shown in Studio after install)?assignee=you@example.com
8. ```
9. 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 → issue assigned
// Fires when an issue's assignee changes. Add ?assignee=you@example.com to the URL to only
// hear about issues assigned to you.
// Docs: https://linear.app/developers/webhooks

// Linear priority (0 none, 1 urgent … 4 low) → push priority.
const PRIORITIES = { 1: 1, 2: 0, 3: 0, 4: -1, 0: 0 }

// 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 issue updates where the assignee changed to someone.
    if (body.type !== "Issue" || body.action !== "update" || !("assigneeId" in (body.updatedFrom ?? {})) || !data.assignee) {
        console.log("Not an issue assignment — skipping")
        return null
    }

    // ?assignee=jane@example.com (or a name) limits pushes to one person's assignments.
    const only = typeof request.query?.assignee === "string" ? request.query.assignee.trim().toLowerCase() : ""
    const matches = [data.assignee.email, data.assignee.name].some((value) => typeof value === "string" && value.toLowerCase() === only)

    if (only && !matches) {
        console.log("Assigned to someone else — skipping")
        return null
    }

    const details = [data.team?.key, data.priority ? data.priorityLabel : null, data.state?.name, body.actor?.name ? `by ${body.actor.name}` : null]

    return {
        title: `👤 ${data.identifier ? `${data.identifier} ` : ""}assigned to ${data.assignee.name ?? "someone"}`,
        message: [data.title, ...details].filter(Boolean).join(" · "),
        topic: "Linear",
        priority: Object.prototype.hasOwnProperty.call(PRIORITIES, data.priority) ? PRIORITIES[data.priority] : 0,
        buttons: link(data.url ?? body.url, "Open issue"),
    }
}
```

## Linear Issue webhook payload (sample)

```json
{
  "url": "https://linear.app/acme/issue/ENG-123/checkout-total-is-off-by-one-cent",
  "data": {
    "id": "2174add1-f7c8-44e3-bbf3-2d60b5ea8bc9",
    "url": "https://linear.app/acme/issue/ENG-123/checkout-total-is-off-by-one-cent",
    "team": {
      "id": "t1",
      "key": "ENG",
      "name": "Engineering"
    },
    "state": {
      "id": "s-todo",
      "name": "Todo",
      "type": "unstarted",
      "color": "#e2e2e2"
    },
    "title": "Checkout total is off by one cent",
    "labels": [],
    "number": 123,
    "assignee": {
      "id": "u2",
      "name": "Sam Lee",
      "email": "sam@example.com"
    },
    "priority": 2,
    "createdAt": "2026-09-29T09:00:00.000Z",
    "identifier": "ENG-123",
    "priorityLabel": "High"
  },
  "type": "Issue",
  "actor": {
    "id": "b5ea5f1f-8adc-4f52-b4bd-ab4e84cf51ba",
    "name": "Jane Doe",
    "type": "user",
    "email": "jane@example.com"
  },
  "action": "update",
  "createdAt": "2026-09-29T09:00:00.000Z",
  "webhookId": "000042e3-d123-4980-b49f-8e140eef9329",
  "updatedFrom": {
    "updatedAt": "2026-09-29T08:59:00.000Z",
    "assigneeId": null
  },
  "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.
