@PublicApi public interface

AssigneeService

com.atlassian.jira.bc.user.search.AssigneeService
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

Service that retrieves issue-assignable ApplicationUser objects.

Assignees may be filtered on a search string or on recent issue or user history.

Summary

Public Methods
Collection<ApplicationUser> findAssignableUsers(String query, Issue issue, ActionDescriptor actionDescriptor)
Get assignable Users based on a query string and issue.
Collection<ApplicationUser> findAssignableUsers(String query, Project project)
Get assignable Users based on a query string and project.
List<ApplicationUser> getAssignableUsers(Collection<Issue> issues, ActionDescriptor actionDescriptor)
Get all ApplicationUsers that may have all of the given Issues assigned to them, for a given workflow state.
List<ApplicationUser> getAssignableUsers(Issue issue, ActionDescriptor actionDescriptor)
Get all ApplicationUsers that may have an Issue assigned to them, for a given workflow state.
Set<String> getRecentAssigneeKeysForIssue(Issue issue)
Returns the keys of Users that the given Issue has recently been assigned to.
Set<String> getRecentAssigneeKeysForUser(ApplicationUser remoteUser)
Returns the keys of ApplicationUsers that have recently been assigned to issues by the specified com.atlassian.jira.user.ApplicationUser.
Set<String> getRecentAssigneeNamesForIssue(Issue issue)
Returns the names of Users that the given Issue has recently been assigned to.
Set<String> getRecentAssigneeNamesForUser(ApplicationUser user)
Returns the names of ApplicationUsers that have recently been assigned to issues by the specified com.atlassian.jira.user.ApplicationUser.
List<ApplicationUser> getSuggestedAssignees(Issue issue, ApplicationUser loggedInUser, List<ApplicationUser> assignableUsers)
Returns a list of suggested Assignee ApplicationUsers for a given Issue and logged-in com.atlassian.jira.user.ApplicationUser.
List<ApplicationUser> getSuggestedAssignees(Issue issue, ApplicationUser loggedInUser, ActionDescriptor actionDescriptor)
Returns a list of suggested Assignee ApplicationUsers for a given Issue and logged-in com.atlassian.jira.user.ApplicationUser.
List<ApplicationUser> getSuggestedAssignees(Set<String> suggestedAssigneeNames, List<ApplicationUser> assignableUsers)
Converts a set of suggested assignee name Strings to a list of suggested ApplicationUser objects.
boolean isAssignable(Project project, ApplicationUser user)
Determines if a user is assignable to an issue in a project.
boolean isAssignable(Issue issue, ApplicationUser user, ActionDescriptor actionDescriptor)
Determines if a user is assignable to an issue.
Map<StringBoolean> makeUniqueFullNamesMap(Collection<ApplicationUser> users)
Converts a collection of Users to a Map where the key is the com.atlassian.jira.user.ApplicationUser full name and the value is true or false.

Public Methods

public Collection<ApplicationUser> findAssignableUsers (String query, Issue issue, ActionDescriptor actionDescriptor)

Get assignable Users based on a query string and issue.

Matches on the start of username, Each word in Full Name & email.

Results are sorted according to the UserCachingComparator.

Parameters
query String to search for.
issue Issue to check Assignee permissions against
actionDescriptor an com.opensymphony.workflow.loader.ActionDescriptor describing the context in which the Assignee is being searched
Returns

public Collection<ApplicationUser> findAssignableUsers (String query, Project project)

Get assignable Users based on a query string and project.

Matches on the start of username, Each word in Full Name & email.

Results are sorted according to the UserCachingComparator.

Parameters
query String to search for.
project Project check Assignee permissions against
Returns

public List<ApplicationUser> getAssignableUsers (Collection<Issue> issues, ActionDescriptor actionDescriptor)

Get all ApplicationUsers that may have all of the given Issues assigned to them, for a given workflow state.

The ActionDescriptor may be used to check for workflow states that only allow a subset of normally-assignable users.

Note: This method is exactly equivalent to getAssignableUsers(Issue, ActionDescriptor), but returns only those users that are assignable for all of the issues. This is significantly more efficient than calling getAssignableUsers(Issue, ActionDescriptor) multiple times and filtering the lists yourself.

Parameters
issues the Issues to find assignable users for
actionDescriptor workflow action descriptor to filter users on
Returns
  • a list of Users sorted by name

public List<ApplicationUser> getAssignableUsers (Issue issue, ActionDescriptor actionDescriptor)

Get all ApplicationUsers that may have an Issue assigned to them, for a given workflow state.

The ActionDescriptor may be used to check for workflow states that only allow a subset of normally-assignable users.

Parameters
issue the Issue to find assignable users for
actionDescriptor workflow action descriptor to filter users on
Returns
  • a list of Users sorted by name

public Set<String> getRecentAssigneeKeysForIssue (Issue issue)

Returns the keys of Users that the given Issue has recently been assigned to.

The current assignee should be included in the returned list.

Parameters
issue Issue to get recent assignees for
Returns
  • a Set of assignee keys

public Set<String> getRecentAssigneeKeysForUser (ApplicationUser remoteUser)

Returns the keys of ApplicationUsers that have recently been assigned to issues by the specified com.atlassian.jira.user.ApplicationUser.

Parameters
remoteUser com.atlassian.jira.user.ApplicationUser to check for assignees in history manager
Returns
  • a Set of assignee usernames

public Set<String> getRecentAssigneeNamesForIssue (Issue issue)

Returns the names of Users that the given Issue has recently been assigned to.

The current assignee should be included in the returned list.

Parameters
issue Issue to get recent assignees for
Returns
  • a Set of assignee usernames

public Set<String> getRecentAssigneeNamesForUser (ApplicationUser user)

Returns the names of ApplicationUsers that have recently been assigned to issues by the specified com.atlassian.jira.user.ApplicationUser.

Parameters
user com.atlassian.jira.user.ApplicationUser to check for assignees in history manager
Returns
  • a Set of assignee usernames

public List<ApplicationUser> getSuggestedAssignees (Issue issue, ApplicationUser loggedInUser, List<ApplicationUser> assignableUsers)

Returns a list of suggested Assignee ApplicationUsers for a given Issue and logged-in com.atlassian.jira.user.ApplicationUser.

This version accepts a pre-populated list of assignable Users to filter.

Parameters
issue Issue to get suggested Assignees for
loggedInUser the user getting the suggestions, whose Assignee history may be queried
assignableUsers a list of ApplicationUsers to filter
Returns
  • List of ApplicationUser objects deemed relevant to the given Issue and com.atlassian.jira.user.ApplicationUser.

public List<ApplicationUser> getSuggestedAssignees (Issue issue, ApplicationUser loggedInUser, ActionDescriptor actionDescriptor)

Returns a list of suggested Assignee ApplicationUsers for a given Issue and logged-in com.atlassian.jira.user.ApplicationUser.

This version accepts a pre-populated list of assignable Users to filter.

Parameters
issue Issue to get suggested Assignees for
loggedInUser the user getting the suggestions, whose Assignee history may be queried
actionDescriptor workflow action descriptor to filter users on
Returns
  • List of ApplicationUser objects deemed relevant to the given Issue and com.atlassian.jira.user.ApplicationUser, sorted by UserBestNameComparator

public List<ApplicationUser> getSuggestedAssignees (Set<String> suggestedAssigneeNames, List<ApplicationUser> assignableUsers)

Converts a set of suggested assignee name Strings to a list of suggested ApplicationUser objects.

Suggested user names may not be returned as suggested users if they are not in the assignable user list.

Parameters
suggestedAssigneeNames the names of the users to return
assignableUsers a list of Users to filter by the suggested assignee names
Returns
  • a filtered List of assignable Users that are suggested as Assignees

public boolean isAssignable (Project project, ApplicationUser user)

Determines if a user is assignable to an issue in a project.

Parameters
project the project.
user the user to check.
Returns
  • true if user is assignable to issues in the project, false if not.

public boolean isAssignable (Issue issue, ApplicationUser user, ActionDescriptor actionDescriptor)

Determines if a user is assignable to an issue.

Parameters
issue the issue.
user the user to check.
Returns
  • true if user is assignable to the issue, false if not.

public Map<StringBoolean> makeUniqueFullNamesMap (Collection<ApplicationUser> users)

Converts a collection of Users to a Map where the key is the com.atlassian.jira.user.ApplicationUser full name and the value is true or false.

The value will be true if no other user with that exact full name exists. The value will be false if at least one other user with that exact full name exists.

Parameters
users a collection of Users that may contain multiple users with the same full name
Returns
  • a map of user full name Strings to a uniqueness boolean flag