Creating a Bitbucket Server plugin

Just like the other Atlassian web applications, Bitbucket Server embeds the Atlassian Plugin Framework and has full support for the Atlassian Plugin SDK.

The first step for any developer embarking on tackling an Atlassian plugin is to install the Atlassian Plugin SDK. Once you're comfortable with the SDK, you have three options with how to proceed: starting from scratch, following a tutorial or forking an existing plugin.

Starting from scratch

If you have some experience with Bitbucket Server plugins or the Atlassian plugin framework, you might consider starting from scratch by creating a plugin using the Atlassian SDK:

  1. Install the Atlassian Plugin SDK.
  2. Run atlas-create-stash-plugin and follow the prompts to create your plugin.
  3. Run atlas-create-stash-plugin-module from the root directory of your plugin or hand edit your atlassian-plugin.xml file to add additional modules to your plugin.
  4. Run atlas-run from the root directory of your plugin to start Bitbucket Server with your plugin installed. See the Atlassian Plugin SDK Documentation for more information on developing and debugging your plugin.
  5. Use the reference materials and examples from this site to flesh out the functionality of your plugin.

Video tutorial

See the above commands in action in this 30 minute video tutorial.

Note: This tutorial pre-dates the renaming of the product to "Bitbucket Server" from "Stash", but is still a useful resource.

Following a tutorial

  1. Install the Atlassian Plugin SDK.
  2. Choose and follow one of the Bitbucket Server plugin tutorials.

Forking an existing plugin

  1. Install the Atlassian Plugin SDK.
  2. Create a Bitbucket account.
  3. Browse our collection of open source Bitbucket Server plugins and fork it into your personal account. You can choose whether to make your fork public or private.
  4. Modify the plugin to suit your needs.