The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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:

https://confluence.atlassian.com/bitbucketserver/automatically-decline-inactive-pull-requests-1027119967.html#:~:text=the%20project%20level.-,To%20configure%20the%20automatic%20declining%20of%20inactive%20pull%20requests%20in,Repository%20settings%20%3E%20Auto%2Ddecline.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Saxea _Flowie_
Atlassian Partner
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.

DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events