Stash notifier plugin

I'm currently trying to write a plugin for Stash which will notify me when 
ever there is a push event. However, I am unable to find a way to obtain 
the commit messages related to the push event. Is there a way for me to
do this from the Java API?
Thanks for any help!

1 answer

1 accepted

Hi ,

If you're using Stash [edit: 2.0] or later you can get the collection of RefChanes and call through to the HistoryService:

for (RefChange change : event.getRefChanges()) {
    Page<Changeset> changesets = historyService.getChangesetsBetween(repository, change.getFromHash(), change.getToHash(), new PageRequestImpl(0, 20));
    // TODO

I hope that helps.



Thats really helpful. Thanks very much. Seems like the documentation is a little lacking for people who are new to this like me. Thanks again!


I agree - it's a little hard to know where to start when writing plugins. We've just recently created a space for all our examples which might be another place to look:

Hopefully over time our documentation and examples will improve.

Good luck.


Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

676 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot