How to create a Bamboo Event Listener

You can find more information on the event framework and @EventListener annotation.

UNfortunately bamboo docs for the listener module are outdated, and half right (you need to register the listener class) and half wrong (you don’t extend any classes). To find events in addition to the ones listed on the docs, you’ll need to explore the javadocs to find actual events. I use the full class index for bamboo and just filter for “Event” All Classes (Atlassian Bamboo 5.7.1 API) to see what possible events to listen to.

YOu only need to register 1 event listener in your atlassian-plugin.xml which specifies a class with annotated methods (as seen in the example you shared). You may decide to use multiple classes for clear isolation of responsibility however.

So in short, Alexey was right, and it not fits the more general pattern used across atlassian tools. I have not confirmed, but if using Spring Scanner (which I certainly recommend), you may not need to declare <bambooEventListener> at all, and just annottate the class with @Component

1 Like