Hello, has anyone gotten custom events working within IssueService? When I call update with my custom event, I receive no notifications.
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.bc.issue.IssueService import com.atlassian.jira.bc.issue.IssueService.UpdateValidationResult import com.atlassian.jira.bc.issue.IssueService.IssueResult import com.atlassian.jira.issue.IssueInputParameters import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.security.JiraAuthenticationContext import com.atlassian.jira.user.ApplicationUser import org.apache.log4j.Logger import org.apache.log4j.Level // com.spacex.EventTest Logger log = Logger.getLogger('com.spacex.EventTestFire') log.setLevel(Level.DEBUG) EventDispatchOption event = EventDispatchOption.Factory.get(10600L) JiraAuthenticationContext context = ComponentAccessor.getComponent(JiraAuthenticationContext.class) IssueService issueService = ComponentAccessor.getComponent(IssueService.class) IssueInputParameters input = issueService.newIssueInputParameters() ApplicationUser user = context.getLoggedInUser() Long issueId = 1329955L String description = 'This should be a notification fired by the Issue Updated (Limited) custom event with id 10600L' input.setDescription(description) IssueService.UpdateValidationResult validation = issueService.validateUpdate(user, issueId, input) assert validation.isValid() IssueService.IssueResult result = issueService.update(user, validation, event, true) assert result.isValid()
If I configure ‘Notify Myself’ and a notification scheme with ‘ISSUE_UPDATED’ set to myself, I receive an email. However, if I configure ‘Notify Myself’ and a notification scheme with ‘EventDispatchOption.Factory.get(10600L)’ set to myself, NOTHING is sent. I have a template set up and if I manually fire the event, then I can get sent emails. This purely seems to be a problem with IssueService, though when walking the source code I can’t seem to find any issue with my custom event getting passed in.
So… do we not use IssueService with custom events then? Just back down to IssueManager? It just seems surprising as it appears to support Custom Events just fine from the method signature.