Detecting when an issue is closed


I've written a plugin to update our summary database with bits of information from JIRA. I have an eventlistener that does stuff when an issue gets created, updated or closed.

The method is pretty simple


public void onIssueEvent(final IssueEvent event) {
Long eventTypeId = event.getEventTypeId();
Issue issue = event.getIssue();

log.debug("Issue {}, generated eventtype {}", issue.getKey(),

// on insert or update
if (eventTypeId.equals(EventType.ISSUE_CREATED_ID)
|| eventTypeId.equals(EventType.ISSUE_UPDATED_ID)) {"Issue {} has been created at {}.", issue.getKey(),
} else if (eventTypeId.equals(EventType.ISSUE_RESOLVED_ID)) {"Issue {} has been resolved at {}.", issue.getKey(),
} else if (eventTypeId.equals(EventType.ISSUE_CLOSED_ID)) {"Issue {} has been closed at {}.", issue.getKey(),



The problem is that it seems to detect successfully when a JIRA issue is created or updated, but the closed function never gets called.

I tracked an issue down in the logs for when it gets closed in the workflow and all I get is

Issue OPS-22979, generated eventtype 13


I'm not sure what eventtype 13 is but it certainly isn't invoking the closed code. The resolved code never seems to get called either.


Can anyone propose how I can successfully detect closure of tickets please?

1 answer

1 accepted

Accepted Answer
0 votes
Mizan Community Champion Oct 03, 2017

Can you check in the workflow transitions post function that the 'Issue Closed' event is being fired when the issue is closed.

It may be possible that when issue is closed this event is not fired. Sorry , even I am not sure about eventtype 13

(I suspect that a generic event is being fired instead, Normally when the workflow is changed we forget to update the events accordingly and live with the generic event)

Thanks - I'll get one of the team to look into it

Brilliant - that has fixed it.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

23,199 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you