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

pull request event listener triggered multiple times for the same operation

Daniel Szabo February 14, 2015

I am new to stash (and to java smile) plugin development. Tried the most simplest, used a logger to log out some details when a pull request operation happens.

the relevant part is here:

@EventListener
public void testPullReqListener(PullRequestEvent event) {
LOGGER.debug("@@pullreq: " + event.getAction().name());

}

What I don't understand is that this is triggered multiple times (From the ide in the debugger it fires twice, and in the log output I see three @@pullreq entries when for example, I create a new pull request. Could someone tell me why is this the case and how can I handle a pull request event only once?  

1 answer

1 accepted

3 votes
Answer accepted
Mike Friedrich
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.
February 14, 2015

The PullRequestEvent has e few derived classes for different pull request actions. You get one for each action happening. Check the Atlassian API docs for details.

Daniel Szabo February 15, 2015

thank you, PullRequestActivityEvent subclass is the one I was looking for.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events