#  Bitbucket Server Plugin Tutorials

This page contains a selection of tutorials for implementing selected plugin points from Bitbucket Server.

## Controlling when pull requests can be merged
[This tutorial](controlling-when-pull-requests-can-be-merged.html) will take you through the steps required to write a plugin containing a
[Merge Request Check](../reference/plugin-module-types/merge-check.html)
which is designed to prevent pull requests from being merged unless the user performing the merge is an administrator for the target repository.

After completing this tutorial you will have learned to do the following:

 * Generate a Bitbucket Server plugin using Atlassian SDK
 * Implement a merge request check in Java
 * Declare a merge request check in your plugin's atlassian-plugin.xml
 * Use various Bitbucket Server services and the merge request check API
 * Internationalize the messages your plugin emits

[Check out the "Controlling when pull requests can be merged" tutorial](controlling-when-pull-requests-can-be-merged.html).

## Creating a repository hook (video)
[This 30 minute video tutorial](https://developer.atlassian.com/blog/2015/01/beer-o-clock-stash-plugin-tutorial/) will
take you through creating, deploying and debugging a simple repository hook plugin using the Atlassian SDK.

After completing this tutorial you will have learned to do the following:

 * Generate a Bitbucket Server plugin using Atlassian SDK
 * Understand the basic structure of an Atlassian plugin
 * Implement a pre-receive hook in Java
 * Start a local development Bitbucket Server server
 * Deploy a Bitbucket Server plugin to your local server
 * Attach a debugger to Bitbucket Server

[Check out the "Beer O'Clock Hook" tutorial](https://developer.atlassian.com/blog/2015/01/beer-o-clock-stash-plugin-tutorial/).

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

## Decorating the user profile and account pages

Adding custom content to the public user profile, or a user's account management pages is easy! Follow the following tutorials:

* [User profile](decorating-the-user-profile.html)
* [User account](decorating-the-user-account.html)

## Showing related items on a pull request

[This tutorial](pull-request-overview.html) will take you through the steps required to add custom content to the Overview tab
of a pull request.

After completing this tutorial you will have learned to do the following:

 * Find plug-in points in Bitbucket Server's UI for adding content
 * Define a [Client Web Panel](../reference/plugin-module-types/client-web-panel.html)
 * Use custom CSS and JS in your panel with [Web Resource](https://developer.atlassian.com/display/DOCS/Web+Resource+Plugin+Module) dependencies

[Check out the "Pull Request Overview" tutorial](pull-request-overview.html).