Skip to content

Every 5 minutes

Post new Bitbucket pull requests to Slack

Each newly opened pull request shows up in your team channel with its author and reviewers.

Runs
Every 5 minutes
Apps
Bitbucket
AI
Not needed
Access
read:pullrequest

Send this to your assistant

Create a ClickRuntime automation: every 5 minutes, check the acme/api repo in Bitbucket and post any new pull request to #code-review in Slack with the title, author and assigned reviewers.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A reviewer who waits for Bitbucket's email notifications gets them in a heap with everything else, and the pull request that blocks a release can sit unnoticed behind a hundred other messages. On a busy repo, a developer opens a pull request at 10 am, the reviewer sees it at 3 pm, the first comment arrives the next morning and the fix is merged two days after the work was finished.

Every five minutes, ClickRuntime lists the open pull requests in your repository, compares their IDs with the ones it has already remembered and posts only the new ones to Slack, with the title, author and link. It then stores the new IDs so nobody is announced twice. Because it checks on a schedule rather than waiting for an event, there is no webhook to set up in Bitbucket.

Small teams that want a visible review queue in a channel they already watch will like it.

What you get out of it

  • Reviewers hear about work within minutes

    A pull request appears in Slack within about five minutes of being opened. The first review comes while the author still remembers the code, which shortens the whole feedback loop.

  • Hotfixes get eyes quickly

    When a pull request fixes a production problem, a channel post draws attention in a way a buried email cannot. Faster review of urgent fixes means shorter customer-facing outages. That matters most on Fridays, when waiting reviews quietly push work into the next week.

  • A shared queue everyone can see

    Because the post lives in a channel, the whole team sees what is waiting. Someone free picks it up without being assigned, and nobody assumes a colleague already has it.

  • No duplicate announcements

    Remembering IDs means each pull request is posted once, even though the check repeats all day. The channel stays readable and people keep paying attention to it. A quiet, trustworthy feed is the difference between a channel people watch and one they mute.

  • No webhook configuration needed

    Because it polls the repository on a short interval, you do not need admin rights to add a webhook in the Bitbucket settings. Read access to the pull requests is enough to start.

How it works

What happens, step by step

  1. Every five minutes ClickRuntime checks your Bitbucket repository for open pull requests.

  2. It skips the ones it has already posted.

  3. Each new pull request goes to your Slack channel with its title, author, reviewers and a link.

Before it runs live

  • Connect Bitbucket

What you get

RunsEvery 5 minutes
Post new Bitbucket pull requests to Slacktoday, 9:00Succeeded
Slack · #code-reviewPR #142: Add rate limiting to /orders by Sam Patel (reviewers: Alex Kim) https://bitbucket.org/acme/api/pull-requests/142

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Bitbucket steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
get_alerted_on_new_pull_requests.pyexample
from clickruntime import on_trigger, credentials, http, notify, state, report_fetched

BB = "https://api.bitbucket.org/2.0"

def bb(path, **params):
    resp = http.get(f"{BB}{path}", headers={"Authorization": f"Bearer {credentials.secret('BITBUCKET_TOKEN')}"}, params=params)
    resp.raise_for_status()
    return resp.json()

@on_trigger
def run(event):
    prs = bb("/repositories/acme/api/pullrequests", state="OPEN", pagelen=50, fields="+values.reviewers")["values"]
    seen = state.get("seen")
    new = [p for p in prs if seen is not None and p["id"] not in seen]
    report_fetched(len(new))
    if seen is not None and not new:
        return {"posted": 0}
    for p in new:
        reviewers = ", ".join(r["display_name"] for r in p.get("reviewers", [])) or "none"
        notify.slack(f"PR #{p['id']}: {p['title']} by {p['author']['display_name']} (reviewers: {reviewers})\n"
                     f"{p['links']['html']['href']}", channel="#code-review")
    state.set("seen", list(set(seen or []) | {p["id"] for p in prs}))
    return {"posted": len(new)}

FAQ

Common questions

Will I see a pull request again if it is updated?
No. The workflow remembers each pull request ID the first time it appears and does not post that ID again, so later pushes, comments or reopenings are not announced. You get one message per new pull request.
Why every five minutes and not instantly?
This version checks on a schedule rather than receiving a webhook, so a pull request can wait up to about five minutes before it appears. That delay is usually fine for reviews, and it avoids needing webhook admin permissions on the repository.
Can it skip draft or bot-authored pull requests?
It can. The fetched pull request includes its author and title, so a rule such as ignoring pull requests from a dependency bot or titles starting with WIP is straightforward to add. Name the exclusion to your AI assistant and check the proposed edit.
What permissions does it need?
read:pullrequest. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Post new Bitbucket pull requests to Slack” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.