Listener
import com.atlassian.event.api.EventListener;
import com.atlassian.event.api.EventPublisher;
import com.atlassian.jira.event.issue.IssueEvent;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
public class Listener implements InitializingBean, DisposableBean { private final EventPublisher eventPublisher; public Listener(EventPublisher eventPublisher) { this.eventPublisher = eventPublisher; } @Override public void afterPropertiesSet() throws Exception { eventPublisher.register(this); } @Override public void destroy() throws Exception { eventPublisher.unregister(this); } @EventListener public void onIssueEvent(IssueEvent issueEvent) { if (Objects.equals(issueEvent.getEventTypeId(), EventType.ISSUE_CREATED_ID)) { // some code } } }
and to atlassian-plugin.xml
<atlassian-plugin> ........ <component key="eventListener" class="Listener"> <description>Class that processes the incoming JIRA issue events.</description> </component> ........ </atlassian-plugin>
Hello All,
How can I have a event for component created in specific project? I only find issue_created, issue_updated etc i.e with the issues.
How about for components and versions which are project specific.
Thanks
Naveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.