Hi All,
for a usecase I have, I need to trigger a mail from a scriptrunner script (groovy). The Logical idea is to trigger an event from my code and pick up the custom event with JETI.
This is the code I use:
import com.atlassian.jira.event.issue.IssueEventBundle
import com.atlassian.jira.event.issue.IssueEventManager
import com.atlassian.jira.event.issue.IssueEventBundleFactory
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.issue.IssueEvent
Long EVENT_ID = new Long("10000")
def issueManager = ComponentAccessor.getIssueManager()
def user = ComponentAccessor.getUserManager().getUserByName('user_worker')
IssueEventManager issueEventM = ComponentAccessor.getIssueEventManager()
IssueEventBundleFactory issueEventFactory = (IssueEventBundleFactory) ComponentAccessor.getComponent(IssueEventBundleFactory.class)
IssueEventBundle eventBundle = issueEventFactory.wrapInBundle(new IssueEvent (issue, null, user, EVENT_ID, true))
issueEventM.dispatchEvent(eventBundle)
This is indeed triggering an event, which sends me a standard JIRA notification (which I do not want) . But JETI is not picking it up (even tough it has been configured).
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.