Announce merged Bitbucket PRs and close the Linear ticket

By General Input

The moment a Bitbucket pull request merges into main, post a short release note to Slack and mark the linked Linear issue as done.

Integrations

  • Bitbucket
  • Slack Bot
  • Linear

Type

Agentic Task

Categories

  • Engineering
  • Product

Trigger: a Bitbucket webhook fires on the pullrequest:fulfilled event (a pull request has been merged). One event = one run.

First, gate on the destination branch. Read the destination branch name from the webhook payload. If it is not main or master, stop immediately and do nothing — this workflow is only for release merges, not intermediate feature-to-feature merges.

Then pull the merged PR's full context from Bitbucket. Use Get Pull Request (bitbucket) to fetch the title, description, author display name, merge commit hash, source branch, destination branch, and the html link back to the PR. Use List Pull Request Commits (bitbucket) to get the commits that were included in the merge (author, short message, hash).

Detect a Linear issue reference. Scan the PR title, the source branch name, and the PR description in that order for the first match of a Linear-style key: an uppercase team prefix of two to six letters followed by a dash and a number (for example ENG-123, PROD-45, DES-9). Remember whether you found one — the rest of the workflow branches on this.

Map the Bitbucket author to a Slack user. Take the author's display name from the PR and use Look Up User by Email (slackbot) if you can derive an email, otherwise scan the Slack workspace user directory for a real_name or display_name that clearly matches (case-insensitive, allow small differences in spacing or middle initials). If you find a confident match, remember the Slack user id so you can @-mention them (<@USERID>). If not, just use their plain display name in the message — never guess wrongly.

Draft the release note. Keep it to three or four short lines: one line naming what shipped in plain language (derived from the PR title and description, not a copy-paste of the branch name), one line crediting the author with the @-mention, and a line with a link back to the PR. If a Linear key was detected, mention it in the note. The tone is a shipping announcement for the team, not a marketing blurb.

Post the note with Send a Message (slackbot) to the configured release announcement channel. Then use Get Permalink (slackbot) on the message you just posted to get a permanent link — you'll use it in the Linear comment.

If a Linear issue reference was detected: use Update Issue (linear) to transition that issue to the Done state (look up the workflow state id for the target team's Done state), and use Add Comment to Issue (linear) to add a comment that links the Bitbucket merge commit URL and the Slack release note permalink. Keep the comment factual: one line saying it shipped, plus the two links.

If no Linear issue reference was found, skip the Linear step entirely and finish. The Slack announcement still goes out — that path is not a failure.

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasonLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsLinkedIn Ads budget pacing dashboard for every client accountGive your team Looker numbers without buying more seatsPause marketing emails to escalated customers, then restore them