Simple notifications: Java/Groovy api
Public Java classes:
package com.jibrok.jira.plugins.simplenotification.api
public interface NotificationQueue {
void add(ApplicationUser applicationUser, String title, String body, NotificationType type, NotificationClose close);
void add(Collection<ApplicationUser> applicationUsers, String title, String body, NotificationType type, NotificationClose close);
void add(Group group, String title, String body, NotificationType type, NotificationClose close);
}
public enum NotificationType {
error, warning, info, success
}
public enum NotificationClose {
auto, manual, never, after_click
}
How use in ScriptRunner for Jira:
import com.jibrok.jira.plugins.simplenotification.api.*
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.atlassian.jira.component.ComponentAccessor
@WithPlugin("com.jibrok.jira.plugins.simple-notifications-for-jira")
@PluginModule
NotificationQueue notificationQueue
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
notificationQueue.add(currentUser, "Title", "Body", NotificationType.error, NotificationClose.manual)