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).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.