Bitbucket pull request notifications on your phone.

Get a push notification when a Bitbucket pull request is opened, approved, gets a change request or a comment, or is merged.

pullrequest:createdCode hostingPull requests
How it works

Three steps to your first push

STEP 01

Install the recipe

One click in Studio gives you a personal webhook URL.

STEP 02

Paste your URL into Bitbucket

Add it as a webhook for Pull request: Created.

STEP 03

Get a push on your phone

With the text, sound and buttons from the recipe.

Setup

How to set up the Bitbucket pull request: created webhook

  1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL.
  2. In your Bitbucket repository, open Repository settings > Webhooks and click Add webhook.
  3. Enter a title and paste your webhook URL as the URL.https://••••••••/•••••••• your personal URL, shown after install
  4. Under Triggers, pick Choose from a full list of triggers, tick Pull request: Created and save.
  5. Under **Triggers**, pick **Choose from a full list of triggers** and tick the **Pull Request** events you want pushes for:
  6. **Created**: a pull request is opened (drafts are skipped)
  7. **Approved**
  8. **Changes Request created**
  9. **Merged**
  10. **Comment created** (optional; Low priority)
  11. Updates, declines and other comment events are ignored, so ticking extra boxes won't cause noise.
  12. Bitbucket signs deliveries when you set a **Secret** (`X-Hub-Signature: sha256=…`), but JustPush doesn't check that signature yet, so keep your endpoint URL private.
The code

What runs when the webhook arrives

Studio calls handleRequest(request) with the incoming webhook and sends the message it returns. It's yours after install; change anything.

transform.js
1// Bitbucket → pullrequest:* (pull request)
2// Fires when a pull request is opened, approved, gets a change request or a comment, or is merged.
3// Docs: https://support.atlassian.com/bitbucket-cloud/docs/event-payloads/#Pull-request-events
4
5// The pull request events worth a push.
6const ACTIONS = {
7 "pullrequest:created": { emoji: "🔀", verb: "opened", priority: 0 },
8 "pullrequest:approved": { emoji: "👍", verb: "approved", priority: 0 },
9 "pullrequest:changes_request_created": { emoji: "✋", verb: "changes requested", priority: 0 },
10 "pullrequest:comment_created": { emoji: "💬", verb: "comment", priority: -1 },
11 "pullrequest:fulfilled": { emoji: "🟣", verb: "merged", priority: -1 },
12}
13
14// Header names can arrive in any case.
15function header(request, name) {
16 const headers = request.headers || {}
17 const key = Object.keys(headers).find((k) => k.toLowerCase() === name)
18 const value = key ? headers[key] : null
19 return Array.isArray(value) ? value[0] : value
20}
21
22// Look a key up in a table without tripping over inherited names like "toString".
23function pick(table, key, fallback) {
24 return Object.prototype.hasOwnProperty.call(table, key) ? table[key] : fallback
25}
26
27// Keep long text readable in a notification.
28function clip(value, max = 120) {
29 const text = typeof value === "string" ? value.replace(/\s+/g, " ").trim() : ""
30 return text.length > max ? text.slice(0, max - 1) + "…" : text || null
31}
32
33// Only link to real http(s) URLs.
34function link(url, cta) {
35 return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : []
36}
37
38// Without the X-Event-Key header (Studio's Test runner), guess the event from the payload's shape.
39function guess(body) {
40 const pr = body.pullrequest
41 if (!pr || typeof pr !== "object") return null
42 if (body.comment) return "pullrequest:comment_created"
43 if (body.approval) return "pullrequest:approved"
44 if (body.changes_request) return "pullrequest:changes_request_created"
45 if (pr.state === "MERGED") return "pullrequest:fulfilled"
46 return pr.state === "OPEN" ? "pullrequest:created" : null
47}
48
49function handleRequest(request) {
50 const body = request.body && typeof request.body === "object" ? request.body : {}
51 const event = header(request, "x-event-key") ?? guess(body)
52 const what = pick(ACTIONS, event, null)
53 const pr = body.pullrequest
54
55 // Guard: only the pull request events above. Updates, declines and other comment events are skipped.
56 if (!what || !pr || typeof pr !== "object") {
57 console.log(`Ignoring Bitbucket "${event ?? "unknown"}" event`)
58 return null
59 }
60
61 // Drafts aren't ready for eyes yet.
62 if (event === "pullrequest:created" && pr.draft) {
63 console.log("Skipping draft pull request")
64 return null
65 }
66
67 const repo = body.repository?.full_name ?? pr.destination?.repository?.full_name ?? "a repository"
68 const who = body.actor?.display_name ?? body.actor?.nickname
69 const number = pr.id ? `PR #${pr.id}` : "PR"
70 const url = pr.links?.html?.href
71
72 if (event === "pullrequest:comment_created") {
73 return {
74 title: `💬 ${who ?? "Someone"} on ${number}: ${pr.title ?? "a pull request"}`,
75 message: [clip(body.comment?.content?.raw) ?? "New comment", repo].join(" — "),
76 topic: "Bitbucket",
77 priority: what.priority, // Low — read it when you're back in Bitbucket
78 buttons: link(body.comment?.links?.html?.href ?? url, "View comment"),
79 }
80 }
81
82 const from = pr.source?.branch?.name
83 const to = pr.destination?.branch?.name
84
85 return {
86 title: `${what.emoji} ${number} ${what.verb}: ${pr.title ?? "Untitled pull request"}`,
87 message: [repo, from && to ? `${from} → ${to}` : null, who ? `by ${who}` : null].filter(Boolean).join(" · "),
88 topic: "Bitbucket",
89 priority: what.priority, // Normal while it needs eyes, Low once merged
90 buttons: link(url, "View pull request"),
91 }
92}
Payload

The Bitbucket pullrequest:created webhook

This is what Bitbucket sends to your URL for pull request: created. It is a sample, trimmed to the fields recipes use.

pullrequest:created · sample.json
1{
2 "actor": {
3 "type": "user",
4 "uuid": "{a1b2c3d4-0000-4000-8000-000000000001}",
5 "nickname": "sam-lee",
6 "account_id": "557058:00000000-0000-0000-0000-000000000001",
7 "display_name": "Sam Lee"
8 },
9 "repository": {
10 "name": "web",
11 "type": "repository",
12 "uuid": "{673a6070-3421-46c9-9d48-90745f7bfe8e}",
13 "links": {
14 "html": {
15 "href": "https://bitbucket.org/acme/web"
16 }
17 },
18 "full_name": "acme/web",
19 "is_private": true
20 },
21 "pullrequest": {
22 "id": 42,
23 "draft": false,
24 "links": {
25 "html": {
26 "href": "https://bitbucket.org/acme/web/pull-requests/42"
27 }
28 },
29 "state": "OPEN",
30 "title": "Add Apple Pay to checkout",
31 "author": {
32 "type": "user",
33 "nickname": "sam-lee",
34 "display_name": "Sam Lee"
35 },
36 "source": {
37 "branch": {
38 "name": "feature/apple-pay"
39 },
40 "commit": {
41 "hash": "d3022fc0ca3d"
42 }
43 },
44 "reviewers": [],
45 "created_on": "2026-09-28T09:20:11.179678+00:00",
46 "updated_on": "2026-09-28T09:20:11.205705+00:00",
47 "description": "Adds Apple Pay as a payment method.",
48 "destination": {
49 "branch": {
50 "name": "main"
51 },
52 "commit": {
53 "hash": "ce5965ddd289"
54 }
55 },
56 "participants": [],
57 "close_source_branch": true
58 }
59}
FAQ

Bitbucket pull request notifications: questions

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 Bitbucket 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.

Ready when you are

Bitbucket on your phone in two minutes.

Install the recipe, paste one URL, done. Free for 30 days, no credit card required.