JETI and Scriptrunner: how to trigger a JETI mail from scriptrunner

Matthew Van Kuyk May 28, 2018

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).

1 answer

0 votes
Paolo Bolla August 12, 2018

NON

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events