Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to create a bitbucket pipeline for automatic close of pull request after certain days?

Mohit Sharma
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 27, 2023

Hello Community, 


If no activity is observed, I am looking for a way to close all stale Pull Requests in my repositories after a few days. 


Is it possible via the bitbucket pipeline or any other way to achieve this?


This link is not helpful:,To%20configure%20the%20automatic%20declining%20of%20inactive%20pull%20requests%20in,Repository%20settings%20%3E%20Auto%2Ddecline.

1 answer

0 votes
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2023

You can definitely achieve this via pipelines, although I'm not aware of, and couldn't find, any existing pipes designed to handle this task. You'd need to write some custom code that interacts with the Bitbucket API to identify and decline the stale pull requests.

I'm curious, though — are these internal or external PRs? I know it's common to auto-close stale PRs in public repos, so I'm just wondering if that's the case here.

Suggest an answer

Log in or Sign up to answer
Site Admin
AUG Leaders

Atlassian Community Events