@PublicApi public interface

MentionService

com.atlassian.jira.mention.MentionService
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Responsible for publishing MentionIssueEvent when a user has mentioned other users on an issue.

Summary

Public Methods
boolean isUserAbleToMention(ApplicationUser remoteUser)
Whether the specified user is able to mention other users in a JIRA issue.
void sendCommentMentions(ApplicationUser remoteUser, Set<NotificationRecipient> currentRecipients, Comment comment, Comment originalComment)
Given a comment object this method will look for any mentions using the MentionFinder and send e-mails to all users mentioned.
void sendIssueCreateMentions(ApplicationUser remoteUser, Set<NotificationRecipient> currentRecipients, 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.
void sendIssueEditMentions(ApplicationUser remoteUser, Set<NotificationRecipient> currentRecipients, Issue issue, 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.

Public Methods

public boolean isUserAbleToMention (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.

public void sendCommentMentions (ApplicationUser remoteUser, Set<NotificationRecipient> currentRecipients, Comment comment, 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
remoteUser The currently logged in user performing this operation.
currentRecipients A set of recipients already being notified for this mention.
comment the comment to scan for text.
originalComment If a comment was edited provied the original comment so that a comparison can be carried out to only send mentions to new users. May be null

public void sendIssueCreateMentions (ApplicationUser remoteUser, Set<NotificationRecipient> currentRecipients, 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
remoteUser The currently logged in user performing this operation.
currentRecipients A set of recipients already being notified for this mention.
issue the issue whose description will be scanned for metions.

public void sendIssueEditMentions (ApplicationUser remoteUser, Set<NotificationRecipient> currentRecipients, Issue issue, 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
remoteUser The currently logged in user performing this operation.
currentRecipients A set of recipients already being notified for this mention.
issue the issue whose description will be scanned for metions.
comment An optional comment for the edit