Interface MentionService

All Known Implementing Classes:
MentionServiceImpl

@PublicApi public interface MentionService
Responsible for publishing MentionIssueEvent when a user has mentioned other users on an issue.
Since:
v5.0
  • Method Details

    • sendCommentMentions

      @Nonnull MentionService.MentionResult sendCommentMentions(@Nullable Set<NotificationRecipient> currentRecipients, @Nullable ApplicationUser remoteUser, @Nullable Comment comment, @Nullable Comment originalComment)
      Given a comment object this method will look for any mentions using the MentionFinder and send e-mails to all users mentioned.

      Sending mentions can not be performed by anonymous users. The user sending the mentions must have browse users permission and all users mentioned must have permission to browse the issue. Otherwise no e-mails will be sent.

      Parameters:
      currentRecipients - A set of recipients already being notified for this issue event bundle.
      remoteUser - The currently logged in user performing this operation.
      comment - The comment to scan for text.
      originalComment - If a comment was edited provide the original comment so that a comparison can be carried out to only send mentions to new users. May be null
      Since:
      8.9
    • sendIssueCreateMentions

      @Nonnull MentionService.MentionResult sendIssueCreateMentions(@Nullable Set<NotificationRecipient> currentRecipients, @Nullable ApplicationUser remoteUser, @Nonnull Issue issue)
      Given an issue object this method will look for any mentions in the description field using the MentionFinder and send e-mails to all users mentioned.

      Sending mentions can not be performed by anonymous users. The user sending the mentions must have browse users permission and all users mentioned must have permission to browse the issue. Otherwise no e-mails will be sent.

      Parameters:
      currentRecipients - A set of recipients already being notified for this issue event bundle.
      remoteUser - The currently logged in user performing this operation.
      issue - The issue whose description will be scanned for mentions.
      Since:
      8.9
    • sendIssueEditMentions

      @Nonnull MentionService.MentionResult sendIssueEditMentions(@Nullable Set<NotificationRecipient> currentRecipients, @Nullable ApplicationUser remoteUser, @Nonnull Issue issue, @Nullable Comment comment)
      Given an issue that has just been edited and an optional edit comment this method sends mention e-mails to all users mentioned in either the new issue description or option edit comment.

      Mentions will only be sent for users if the description field was edited (as determined by the latest change history for this issue) and only to users that weren't mentioned in the description text previously.

      Parameters:
      currentRecipients - A set of recipients already being notified for this issue event bundle.
      remoteUser - The currently logged in user performing this operation.
      issue - The issue whose description will be scanned for mentions.
      comment - An optional comment for the edit
      Since:
      8.9
    • isUserAbleToMention

      boolean isUserAbleToMention(@Nullable ApplicationUser remoteUser)
      Whether the specified user is able to mention other users in a Jira issue.
      Parameters:
      remoteUser - The user to check mention permissions for.
      Returns:
      true if the user is able to mention other users; false otherwise.
    • getMentionedUsers

      @Nonnull MentionService.Mentions getMentionedUsers(@Nonnull IssueEvent issueEvent)
      Returns mentioned users calculated from passed issueEvent. Sending mentions can not be performed by anonymous users. The user sending the mentions must have browse users permission and all users mentioned must have permission to browse the issue.
      Parameters:
      issueEvent - Event to find mentions for
      Returns:
      Map of users mentioned calculated from passed issueEvent.
      Since:
      8.0