Stash Plugin Tutorials
This page contains a selection of tutorials for implementing selected plugin points from Stash.
Controlling when pull requests can be merged
This tutorial will take you through the steps required to write a plugin containing a Merge Request Check 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 Stash 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 Stash services and the merge request check API
- Internationalize the messages your plugin emits
Check out the "Controlling when pull requests can be merged" tutorial.
Creating a repository hook (video)
This 30 minute video 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 Stash plugin using Atlassian SDK
- Understand the basic structure of an Atlassian plugin
- Implement a pre-receive hook in Java
- Start a local development Stash server
- Deploy a Stash plugin to your local server
- Attach a debugger to Stash
Check out the "Beer O'Clock Hook" tutorial.
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:
Showing related items on a pull request
This tutorial 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 Stash's UI for adding content
- Define a Client Web Panel
- Use custom CSS and JS in your panel with Web Resource dependencies