com.atlassian.jira.bc.user.search
Interface AssigneeService

All Known Implementing Classes:
DefaultAssigneeService

@PublicApi
public interface AssigneeService

Service that retrieves issue-assignable User objects.

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

Since:
v5.0

Method Summary
 Collection<com.atlassian.crowd.embedded.api.User> findAssignableUsers(String query, Issue issue, com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
          Get assignable Users based on a query string and issue.
 Collection<com.atlassian.crowd.embedded.api.User> findAssignableUsers(String query, Project project)
          Get assignable Users based on a query string and project.
 List<com.atlassian.crowd.embedded.api.User> getAssignableUsers(Collection<Issue> issues, com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
          Get all Users that may have all of the given Issues assigned to them, for a given workflow state.
 List<com.atlassian.crowd.embedded.api.User> getAssignableUsers(Issue issue, com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
          Get all Users 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(com.atlassian.crowd.embedded.api.User remoteUser)
          Returns the keys of Users that have recently been assigned to issues by the specified User.
 Set<String> getRecentAssigneeNamesForIssue(Issue issue)
          Returns the names of Users that the given Issue has recently been assigned to.
 Set<String> getRecentAssigneeNamesForUser(com.atlassian.crowd.embedded.api.User user)
          Returns the names of Users that have recently been assigned to issues by the specified User.
 List<com.atlassian.crowd.embedded.api.User> getSuggestedAssignees(Issue issue, com.atlassian.crowd.embedded.api.User loggedInUser, com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
          Returns a list of suggested Assignee Users for a given Issue and logged-in User.
 List<com.atlassian.crowd.embedded.api.User> getSuggestedAssignees(Issue issue, com.atlassian.crowd.embedded.api.User loggedInUser, List<com.atlassian.crowd.embedded.api.User> assignableUsers)
          Returns a list of suggested Assignee Users for a given Issue and logged-in User.
 List<com.atlassian.crowd.embedded.api.User> getSuggestedAssignees(Set<String> suggestedAssigneeNames, List<com.atlassian.crowd.embedded.api.User> assignableUsers)
          Converts a set of suggested assignee name Strings to a list of suggested User objects.
 Map<String,Boolean> makeUniqueFullNamesMap(Collection<com.atlassian.crowd.embedded.api.User> users)
          Converts a collection of Users to a Map where the key is the User full name and the value is true or false.
 

Method Detail

getAssignableUsers

List<com.atlassian.crowd.embedded.api.User> getAssignableUsers(Issue issue,
                                                               @Nullable
                                                               com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
Get all Users 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

getAssignableUsers

List<com.atlassian.crowd.embedded.api.User> getAssignableUsers(Collection<Issue> issues,
                                                               @Nullable
                                                               com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
Get all Users 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

findAssignableUsers

Collection<com.atlassian.crowd.embedded.api.User> findAssignableUsers(String query,
                                                                      Issue issue,
                                                                      com.opensymphony.workflow.loader.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 ActionDescriptor describing the context in which the Assignee is being searched
Returns:
List of User objects that match criteria.

findAssignableUsers

Collection<com.atlassian.crowd.embedded.api.User> 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:
List of User objects that match criteria.

getSuggestedAssignees

List<com.atlassian.crowd.embedded.api.User> getSuggestedAssignees(Issue issue,
                                                                  @Nullable
                                                                  com.atlassian.crowd.embedded.api.User loggedInUser,
                                                                  @Nullable
                                                                  com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
Returns a list of suggested Assignee Users for a given Issue and logged-in User.

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 User objects deemed relevant to the given Issue and User, sorted by UserBestNameComparator

getSuggestedAssignees

List<com.atlassian.crowd.embedded.api.User> getSuggestedAssignees(Issue issue,
                                                                  com.atlassian.crowd.embedded.api.User loggedInUser,
                                                                  List<com.atlassian.crowd.embedded.api.User> assignableUsers)
Returns a list of suggested Assignee Users for a given Issue and logged-in User.

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 Users to filter
Returns:
List of User objects deemed relevant to the given Issue and User.

makeUniqueFullNamesMap

Map<String,Boolean> makeUniqueFullNamesMap(Collection<com.atlassian.crowd.embedded.api.User> users)
Converts a collection of Users to a Map where the key is the User 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

getSuggestedAssignees

List<com.atlassian.crowd.embedded.api.User> getSuggestedAssignees(Set<String> suggestedAssigneeNames,
                                                                  List<com.atlassian.crowd.embedded.api.User> assignableUsers)
Converts a set of suggested assignee name Strings to a list of suggested User 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

getRecentAssigneeNamesForIssue

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
See Also:
getRecentAssigneeKeysForIssue(com.atlassian.jira.issue.Issue)

getRecentAssigneeNamesForUser

Set<String> getRecentAssigneeNamesForUser(com.atlassian.crowd.embedded.api.User user)
Returns the names of Users that have recently been assigned to issues by the specified User.

Parameters:
user - User to check for assignees in history manager
Returns:
a Set of assignee usernames

getRecentAssigneeKeysForIssue

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
See Also:
getRecentAssigneeNamesForIssue(com.atlassian.jira.issue.Issue)

getRecentAssigneeKeysForUser

Set<String> getRecentAssigneeKeysForUser(com.atlassian.crowd.embedded.api.User remoteUser)
Returns the keys of Users that have recently been assigned to issues by the specified User.

Parameters:
user - User to check for assignees in history manager
Returns:
a Set of assignee usernames


Copyright © 2002-2014 Atlassian. All Rights Reserved.