Various JiraEvents are never fired

R September 1, 2013

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:

  • got JIRA event com.atlassian.jira.event.issue.IssueWatcherAddedEvent@1130877f
  • got JIRA event com.atlassian.jira.event.issue.IssueEvent@7f3e2e96[issue=SSP-27,comment=<null>,worklog=<null>,changelog=<null>,eventTypeId=1,sendMail=true,params={eventsource=workflow, baseurl=http://localhost:8080},subtasksUpdated=false]
Quicksearch produces:
  • got JIRA event com.atlassian.jira.event.issue.QuickSearchEvent@118ca680

Changing issue order in Agile backlog produces:

  • got JIRA event com.atlassian.jira.event.issue.IssueEvent@509f093[issue=SSP-23,comment=<null>,worklog=<null>,changelog=[GenericEntity:ChangeGroup][id,51304][author,admin][created,2013-09-02 16:13:06.471][issue,10022],eventTypeId=2,sendMail=false,params={eventsource=action, baseurl=http://localhost:8080},subtasksUpdated=false]

Search (Issues -> Search for Issues) produces nothing (expected IssueSearchEvent)

Viewing an issue produces:

  • /browse/SSP-17 - nothing (expected IssueViewEvent)
  • /secure/ViewIssue.jspa?key=SSP-17 - got JIRA event com.atlassian.jira.event.issue.IssueViewEvent@124b8b03

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?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 1, 2013
R September 2, 2013

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".

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2013

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.

TAGS
AUG Leaders

Atlassian Community Events