Is there a way to use ScriptRunner to prevent branch deletion performed through the UI? (for stash versions prior to 3.10 which don't have this support built-in).
I can see it's possible with a pre-receive hook, but I think this wouldn't prevent a delete through the UI. I had a look through the event hooks but I couldn't see a CancelableEvent for branch deletion.
ScriptRunner events are categorised in cancelable and non-cancelable sections in the Script Event Handlers functionality.
If you use the Script Event Handler functionality and create a custom BranchDeletionRequestedEvent then it should be canceleable, please see this link:
I hope that helps.
Branch permissions in later versions allows you to control who can delete branches. Take a look at https://confluence.atlassian.com/display/BitbucketServer/Using+branch+permissions
For your existing version, you might find the below link helpful.
Hope that helps.
Right. Not sure about ScriptRunner but you might find this helpful. It is compatible with the version you are running.
Maybe time for an upgrade
Announced in this blog, this holiday season we’re celebrating all things CI/CD and between now and the end of 2019 we’ll be showcasing content, use cases, feature announcements and more. One featur...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events