I see the option to delete individual pull requests in Bitbucket server, but need a way to delete unmerged PRs in bulk that are of a certain age.
Yes. Use HTTP DELETE. More info here:
https://docs.atlassian.com/bitbucket-server/rest/5.1.0/bitbucket-rest.html
Requires at least Bitbucket Server 5.1.0.
Alternatively, if you're willing to toast all the source-branches (via "git push --delete") that correspond to your stale PR's, that will automatically close the PR's, and is easy (though somewhat dangerous) to do in bulk. More info here:
https://community.atlassian.com/t5/Bitbucket-questions/Is-there-a-way-to-delete-branches-in-bulk/qaq-p/547331
ahhhh. only on 5.1.0 then. Good to know when we upgrade. Thanks!
Unfortunately the only way to figure out what versions of the REST API support various features is via binary-search (by altering the Bitbucket version directly in the URL)!
e.g., I tried 5.0.2:
NOPE - https://docs.atlassian.com/bitbucket-server/rest/5.0.2/bitbucket-rest.html
Then 6.0.0:
YUP - https://docs.atlassian.com/bitbucket-server/rest/6.0.0/bitbucket-rest.html
And so on until I found the feature appeared in Bitbucket 5.1.0.
p.s. You might like our PR-Booster add-on! It works all the way back to Bitbucket 4.x and provides a pretty substantial bump in functionality (e.g., rebase, squash, amend, and cherry-pick buttons, among other things). Bitbucket's built-in rebase functionality doesn't appear until Bitbucket 5.5.x.
It looks like you're new here. Sign in or register to get started.