The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
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.

TAGS
AUG Leaders

Atlassian Community Events