Create Listener for component created plugin
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
It looks like you're new here. Sign in or register to get started.