I'm attempting to listen for events from a JIRA plugin component which looks like this:
public class JiraEventListener implements InitializingBean, DisposableBean { private static final Logger LOGGER = LoggerFactory.getLogger(JiraEventListener.class); private final EventPublisher eventPublisher; public JiraEventListener(EventPublisher eventPublisher) { this.eventPublisher = eventPublisher; } @Override public void destroy() { eventPublisher.unregister(this); LOGGER.info("unregistered with {}", eventPublisher); } @Override public void afterPropertiesSet() { LOGGER.info("registering with {}", eventPublisher); eventPublisher.register(this); } @EventListener public void onJiraEvent(JiraEvent event) { LOGGER.debug("got JIRA event {}", event); } }
I've found that various events are working fine, while others are seemingly never triggered.
Creating an event produces:
Changing issue order in Agile backlog produces:
Search (Issues -> Search for Issues) produces nothing (expected IssueSearchEvent)
Viewing an issue produces:
Testing with JIRA 6.0.1. I haven't exhaustively tested every event type, but the results so far (especially the last one) lead me to believe that various built-in events cannot be used reliably.
Can anyone shed more light on this and confirm whether the built-in events are expected to work?
Community moderators have prevented the ability to post new answers.
There is no Issue view event. See https://confluence.atlassian.com/display/JIRA/Adding+a+Custom+Event#AddingaCustomEvent-SystemEvents and https://developer.atlassian.com/display/JIRADEV/JIRA-specific%20Atlassian%20Events for the list.
It is safe to rely on events in almost all the cases.
There is an IssueViewEvent in the javadoc, https://developer.atlassian.com/static/javadoc/jira/6.0.1/reference/com/atlassian/jira/event/issue/IssueViewEvent.html , annotated with @PublicApi and described as "Event that is triggered when an issue is viewed".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Interesting. Maybe it was added in 6.x but is not working due to some bug. You might want to raise an issue with Atlassian.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.