IssueEvent EventListener method called twice in plugin


I am currently trying to get into jira plugin development.

My issue is that my EventListener for IssueEvent gets called twice with the same data, which makes things complicated for me.

The method onIssueEvent gets called twice:

public class IssueModificationListener implements DisposableBean, InitializingBean, LifecycleAware {

    private final ApplicationProperties applicationProperties;
    private final EventPublisher eventPublisher;
    private final LifecycleManager lifecycleManager;

    public IssueModificationListener(ApplicationProperties applicationProperties, EventPublisher eventPublisher, LifecycleManager lifecycleManager) {
        this.applicationProperties = applicationProperties;
        this.eventPublisher = eventPublisher;
        this.lifecycleManager = lifecycleManager;

    public void destroy() throws Exception {


    public void afterPropertiesSet() throws Exception {

    public void onStart() {


    public void onIssueEvent(IssueEvent issueEvent) {
        Long eventTypeId = issueEvent.getEventTypeId();
        Issue issue = issueEvent.getIssue();
        if (eventTypeId.equals(EventType.ISSUE_COMMENTED_ID)) {
            System.out.println("Issue commented on");
        } else if (eventTypeId.equals(EventType.ISSUE_COMMENT_EDITED_ID)) {
            System.out.println("Comment edited");
        } else if (eventTypeId.equals(EventType.ISSUE_COMMENT_DELETED_ID)) {
            System.out.println("Comment deleted");

Resulting in the following output:

[INFO] [talledLocalContainer] Comment deleted
[INFO] [talledLocalContainer] Comment deleted

Is there anything I can do to prevent this from happening?

The used jira version is 6.4.12


Thanks in advance!

1 answer

Actually, I just see that eventPublisher.register(this) gets called twice, once in the constructor and in afterPropertiesSet... That might explain things.

Suggest an answer

Log in or Join to answer
Community showcase
Maarten Cautreels
Posted Thursday in Off-topic

Friday Fun: What's your favourite beer/drink

As a Belgian, beer-lover and home brewer, beer is one of my great passions. I love the fact that with just a few ingredients (usually just water, hop and malt) you can create so many different tastes...

281 views 38 9
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot