Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,295,501
Community Members
 
Community Events
165
Community Groups

How can I enable a plugin at the repository level?

I wrote a Bitbucket plugin that listens for the PullRequestOpenedEvent. It works great. But I only want to enable it at the repository level, not the whole system.

I have other plugins that show up under Pull Requests > Merge checks and Workflow > Hooks. They're great. I can enable them at the repository level with a dropdown.

That's all I need for my PullRequestOpenedEvent plugin. How can I achieve this in the easiest way possible? Thanks.

1 answer

1 accepted

0 votes
Answer accepted

PullRequestOpenedEvent is not a repository event of any sort that you can write a hook for. It's a simple event. Pull requests are glorified diffs that you can interact with through the webui.

For this event handler to be configurable you don't have the convenience of the configurable hook system. You would need to add your own repo-settings to control how the event listener acts for each repository. When a PR is created, you can determine which repo it is for and check the plugin configuration to derive what should happen.

Hope that helps - BTW, another good place to post developer questions is https://community.developer.atlassian.com/

Thanks. I didn't know there was another community for development.

I found https://community.atlassian.com/t5/Answers-Developer-Questions/Per-repository-Stash-plugin-configuration-without-hooks/qaq-p/554719 

It is 8 years old. I was surprised it still compiled with Bitbucket 7.14. I am currently trying to strip it down and apply it to my plugin.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.9.1
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,169 views 2 9
Read article

Community Events

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

Events near you