Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Stash notifier plugin

Yin Hong January 28, 2013
Hello,
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

3 votes
Answer accepted
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2013

Hi ,

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

https://developer.atlassian.com/static/javadoc/stash/latest/api/reference/com/atlassian/stash/history/HistoryService.html

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

I hope that helps.

Charles

Yin Hong January 29, 2013

Hello,

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!

cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2013

Hi,

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:

http://atlassian.bitbucket.org/stash/

Hopefully over time our documentation and examples will improve.

Good luck.

Charles

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events