Hello,
I have the following code:
def firstProjectKey = 'ABC'
def getFirstProject = projectManager.getProjectByCurrentKeyIgnoreCase(firstProjectKey)
NotificationSchemeManager nsm = ComponentAccessor.getNotificationSchemeManager()
def firstProjectNotificationScheme = nsm.getSchemeFor(getFirstProject)
Collection<EventType> allEventTypes = etm.getEventTypes()
for (event in allEventTypes) {
def recipientsInProject1 = nsm.getRecipients(event,firstProjectNotificationScheme)
}
My objective is to get for each event (issue created, issue edited, etc.) in the notification scheme of a specific project , the recipients (perhaps a group, reporter, current assignee, a project role, etc.).
I see in here: https://docs.atlassian.com/software/jira/docs/api/7.1.1/com/atlassian/jira/notification/NotificationSchemeManager.html that the getRecipients() method is available, and is expecting : getRecipients(IssueEvent event,SchemeEntity notification)
When running my script in the console I get:
Script console script failed: groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.notification.DefaultNotificationSchemeManager.getRecipients() is applicable for argument types: (com.atlassian.jira.event.type.EventType, com.atlassian.jira.scheme.Scheme) values: [EventType{id=1, name='Issue Created', description='This is the 'issue created' event.', type='jira.system.event.type', templateId=null}, ...] Possible solutions: getRecipients(com.atlassian.jira.event.issue.IssueEvent), getRecipients(com.atlassian.jira.event.issue.IssueEvent, com.atlassian.jira.scheme.SchemeEntity) at Script3131.run(Script3131.groovy:388)
or, if I try with the id:
Script console script failed: groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.notification.DefaultNotificationSchemeManager.getRecipients() is applicable for argument types: (Long, Long) values: [1, 10700] Possible solutions: getRecipients(com.atlassian.jira.event.issue.IssueEvent), getRecipients(com.atlassian.jira.event.issue.IssueEvent, com.atlassian.jira.scheme.SchemeEntity) at Script3135.run(Script3135.groovy:388)
Please let me know what is the expected type of data here.
Thank you!