EventDispatch and Event listener Jira 7.2.X

Hi,

We are working on a plugin for Jira 7.2.X.
Here i noticed a strange issue which i am unable to explain why.

Old way i.e. Jira 6 way of dispatching events dispatches events in Jira 7 too i.e.

ComponentAccessor.getIssueEventManager().dispatchEvent(eventIdAsLong, issue, context, loggedInUser,false);

Where as the Jira 7 way does not dispatch an event and the Lister doe not get any events.

IssueEvent issueEvent = new IssueEvent(issue, context, loggedInUser, eventIdAsLong,false);
IssueEventBundleFactory eventBundleFactory = ComponentAccessor.getComponentOfType(IssueEventBundleFactory.class);
IssueEventBundle eventBundle = eventBundleFactory.wrapInBundle(issueEvent);
ComponentAccessor.getIssueEventManager().dispatchEvent(eventBundle);

 Does anyone know what is the right way to dispatch events in Jira 7?

Thanks in advance,
Parashar

1 answer

This code works for me in Jira 7, looks fairly identical to yours

Long EVENT_ID = new Long("10000")
def appuser = ComponentAccessor.getUserManager().getUserByName('userid')
IssueEventManager issueEventM = ComponentAccessor.getIssueEventManager()
IssueEventBundleFactory issueEventFactory = (IssueEventBundleFactory) ComponentAccessor.getComponent(IssueEventBundleFactory.class)
IssueEventBundle eventBundle = issueEventFactory.wrapInBundle(new IssueEvent (issue, null, appuser, EVENT_ID, true))
issueEventM.dispatchEvent(eventBundle)

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

35 views 0 4
Read article

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