@PublicApi public interface

UserPickerSearchService

com.atlassian.jira.bc.user.search.UserPickerSearchService
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 a collection of User objects based on a partial query string

Summary

Public Methods
boolean canPerformAjaxSearch(ApplicationUser user)
Determines whether the given user could perform AJAX search.
boolean canPerformAjaxSearch(User user)
This method is deprecated. since v6.2. Use canPerformAjaxSearch(com.atlassian.jira.user.ApplicationUser) instead.
boolean canPerformAjaxSearch(JiraServiceContext jiraServiceContext)
Returns true only if UserPicker Ajax search is enabled AND the user in the context has User Browse permission.
boolean canShowEmailAddresses(JiraServiceContext jiraServiceContext)
Whether or not the UserPicker Ajax should search or show email addresses
List<User> findUsers(String nameQuery, String emailQuery, UserSearchParams userSearchParams)
Get Users based on query strings.
List<User> findUsers(JiraServiceContext jiraServiceContext, String query, UserSearchParams userSearchParams)
Get Users based on a query string.
List<User> findUsers(String query, UserSearchParams userSearchParams)
Get Users based on a query string.
List<User> findUsers(JiraServiceContext jiraServiceContext, String query)
Get Users based on a query string.
List<User> findUsersAllowEmptyQuery(JiraServiceContext jiraServiceContext, String query)
Get Users based on a query string.
User getUserByName(JiraServiceContext jiraServiceContext, String query)
Returns a user by exact username
boolean userMatches(ApplicationUser user, UserSearchParams userSearchParams)
Determine whether a user matches the search criteria specified in the userSearchParams parameter.

Public Methods

public boolean canPerformAjaxSearch (ApplicationUser user)

Determines whether the given user could perform AJAX search.

public boolean canPerformAjaxSearch (User user)

This method is deprecated.
since v6.2. Use canPerformAjaxSearch(com.atlassian.jira.user.ApplicationUser) instead.

public boolean canPerformAjaxSearch (JiraServiceContext jiraServiceContext)

Returns true only if UserPicker Ajax search is enabled AND the user in the context has User Browse permission.

Parameters
jiraServiceContext Jira Service Context
Returns
  • True if enabled, otherwise false

public boolean canShowEmailAddresses (JiraServiceContext jiraServiceContext)

Whether or not the UserPicker Ajax should search or show email addresses

Parameters
jiraServiceContext Jira Service Context
Returns
  • True if email addresses can be shown, otherwise false

public List<User> findUsers (String nameQuery, String emailQuery, UserSearchParams userSearchParams)

Get Users based on query strings.

Matches nameQuery on the start of username and each word in Full Name & email.

Matches emailQuery on start of email. Email matching is performed only when userSearchParams.canMatchEmail() is true. Results are sorted according to the userSearchParams.comparator. If userSearchParams.comparator is null, no sorting will be performed.

Parameters
nameQuery the query to search username and display name.
emailQuery the query to search email address, subject to userSearchParams.canMatchEmail.
userSearchParams the search criteria
Returns
  • the list of matched users

public List<User> findUsers (JiraServiceContext jiraServiceContext, String query, UserSearchParams userSearchParams)

Get Users based on a query string.

Matches on the start of username and each word in Full Name & email.

Results are sorted according to the UserCachingComparator.

Parameters
jiraServiceContext Jira Service Context
query String to search for.
userSearchParams Additional search parameters
Returns
  • List of User objects that match criteria.

public List<User> findUsers (String query, UserSearchParams userSearchParams)

Get Users based on a query string.

Matches on the start of username and each word in Full Name & email.

Matches email only when userSearchParams.canMatchEmail() is true. Results are sorted according to the userSearchParams.comparator. If userSearchParams.comparator is null, no sorting will be performed.

Parameters
query the query to search username, display name and email address
userSearchParams the search criteria
Returns
  • the list of matched users

public List<User> findUsers (JiraServiceContext jiraServiceContext, String query)

Get Users based on a query string.

Matches on the start of username and each word in Full Name & email. Only returns active users.

Results are sorted according to the UserCachingComparator.

Parameters
jiraServiceContext Jira Service Context
query String to search for.
Returns
  • List of User objects that match criteria.

public List<User> findUsersAllowEmptyQuery (JiraServiceContext jiraServiceContext, String query)

Get Users based on a query string.

Matches on the start of username and each word in Full Name & email. This will search even if the query passed is null or empty. Only returns active users.

Results are sorted according to the UserCachingComparator.

Parameters
jiraServiceContext Jira Service Context
query String to search for.
Returns
  • List of User objects that match criteria.

public User getUserByName (JiraServiceContext jiraServiceContext, String query)

Returns a user by exact username

Parameters
jiraServiceContext Jira Service Context
query String to search for.
Returns
  • The User object with supplied username.

public boolean userMatches (ApplicationUser user, UserSearchParams userSearchParams)

Determine whether a user matches the search criteria specified in the userSearchParams parameter.

allowEmptyQuery in userSearchParams is ignored.

Parameters
user the user to be matched
userSearchParams the search criteria
Returns
  • true if the user matches the search criteria