Nudge stalled Azure DevOps pull requests every weekday
Every weekday morning we check your open pull requests, work out who is actually blocking each one, and send that person a direct message in Slack.
Every weekday at 9:30am, sweep all open pull requests across my Azure DevOps repositories and nudge the one person who owns the next action on each stalled pull request. Use a cron trigger so this works without depending on service hook configuration.
Start with List Repositories to enumerate the Git repositories in my project, then use List Pull Requests on each repository filtered to active pull requests. For every pull request that survives the filters below, call Get Pull Request for the full detail, including reviewer vote state and timestamps, and List PR Threads to read the comment threads.
Skip draft pull requests, anything opened in the last 24 hours, and any pull request where every assigned reviewer has already voted approved. Treat a pull request as stalled when there has been no new commit, comment, or reviewer vote for at least 2 days. Make that idle threshold a value I can easily change, and measure idle time from the most recent activity of any kind rather than from the creation date.
For each stalled pull request, work out who actually owns the next action. Read the reviewer votes (approved, approved with suggestions, waiting for the author, rejected, or no vote at all) together with the unresolved comment threads. If unresolved threads contain reviewer questions or change requests the author has not answered or addressed, the ball is with the author. If the author has replied to every open thread or pushed new commits since the last review, or if no reviewer has voted at all, the ball is with the reviewer who is silent or who last requested changes. Choose exactly one responsible person per pull request, and note the specific reason so the message can be concrete.
Resolve that person from their Azure DevOps identity to their Slack account with Look Up User by Email, using the email address on their Azure DevOps profile, then use Send a Message to send them a direct message. Each message should name the pull request with its title and link, say how many days it has been idle, and state the single specific next action they owe, for example that three reviewer comments about error handling are still unresolved on their pull request, or that they were added as a reviewer six days ago and have not voted yet. Keep it to a couple of sentences, stay friendly rather than accusatory, and send at most one direct message per person per pull request per run. If no Slack account matches that email address, skip the direct message and still include the pull request in the team summary.
Finish by using Send a Message to post one ranked summary to my engineering channel, ordered with the most blocking and longest idle pull requests first. For each entry show the repository, the pull request title and link, how many days it has been idle, who is blocking it, and the next action they owe. Add a one line total of how many pull requests are stalled so the team sees the whole review queue in one place at standup. If nothing is stalled, post a short all clear instead of staying silent.
What does this prompt do?
- Sweeps every open pull request across your repositories each weekday morning and works out how long each one has been sitting idle.
- Reads the review comments and approval status to decide whether the author needs to make changes or a reviewer needs to take a look.
- Sends the one person who owes the next step a direct Slack message naming the pull request, how long it has stalled, and exactly what to do.
- Posts a single ranked summary to your engineering channel, most blocking and longest waiting first, ready for standup.
What do I need to use this?
- An Azure DevOps account with access to the repositories you want covered
- A Slack workspace where the assistant can send direct messages and post to your engineering channel
- Team members whose Slack account uses the same email address as their Azure DevOps profile, since that is how people are matched
- The name of the Slack channel your team uses for standup
How can I customize it?
- Change how many days a pull request can sit untouched before it counts as stalled, which starts at two days
- Move the run time, or have it run only on certain days of the week
- Limit the sweep to specific repositories, or only to pull requests aimed at your main release branch
FAQs
Will people get pinged about brand new pull requests?
Does everyone involved in the review get a message?
What if someone's Slack email does not match their Azure DevOps email?
Does this change anything in our pull requests?
Can it cover more than one repository?
Related templates
Stage a batch of filings overnight, then approve each completed form from a screenshot before anything is ever submitted.
Pick a client and a date range to see sent, replies, meetings booked and the real deal value your cold email produced, campaign by campaign.
Review every conversation Fin closed as resolved, judge which ones actually stuck, and see what the gap is worth against your bill.
Merge your IT, HR and Facilities queues into one list ranked by SLA time left, then reply, change status and escalate without ever opening Jira.
See every page's translation status at a glance, edit translations side by side with the English, and publish only what your team has actually approved.
One place for sales and ops to request an NDA or vendor agreement, watch its status, and let legal launch the contract in a single click.
Stop letting pull requests rot in the review queue.
Set it up once and the right person hears about the right pull request, every weekday morning.