Hi,
I am on Bamboo 6.1.1 version running locally with atlassian SDK. I would like to create an event listener. How do I proceed with this?
Added
<bambooEventListener key="jobCompleteListener" class="com.vmware.bamboo.plugin.listener.JobCompleteListener"/>
in the atlassian-plugin.xml. That fixed the problem. Thanks for your input guys.
Hi Kaushik,
I hope this Developer documentation helps you to create a sample event listener. With this, you can extend a BuildEvent or a BuildResultEvent. This page has an example of a very basic notification listener.
Hope that helps!
There're two options available:
add to atlassian-plugin.xml
<bambooEventListener key="environmentDependencyListener" class="com.test.MyListener"/>
public class MyListener { @EventListener public void onChainCompleted(final ChainCompletedEvent event) { System.out.println("chain complete "); }}
It's also possible that your class can register itself
private final EventPublisher eventPublisher;PostConstructprivate void postConstruct() {eventPublisher.register(this);}@PreDestroyprivate void preDestroy() {eventPublisher.unregister(this);}@EventListenerpublic void onChainRemoved(@NotNull ChainDeletedEvent chainDeletedEvent) { System.out.println(chainDeletedEvent.getPlanKey());}
Thanks
Thank you!
It looks like you're new here. Sign in or register to get started.