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.
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
Every five minutes ClickRuntime checks your Bitbucket repository for open pull requests.
It skips the ones it has already posted.
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
Build your own
Need it to work differently?
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
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?
Why every five minutes and not instantly?
Can it skip draft or bot-authored pull requests?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get an email when a Bitbucket build fails
As soon as a pipeline or build fails, you get the commit and the pull request it belongs to.
See how it worksGet a morning list of pull requests waiting too long
Every weekday you see which pull requests have been open for more than three days, so reviews do not stall.
See how it worksGet a weekly pull request report per repo
Each Monday you see how many pull requests were opened, merged and declined in every repo last week, and by whom.
See how it worksKeep exploring
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.