Interface UserPickerResourceHelper

All Known Implementing Classes:
UserPickerResourceHelperImpl

public interface UserPickerResourceHelper
  • Method Details

    • findUsersAsBean

      UserPickerResultsBean findUsersAsBean(String query, Integer maxResults, Boolean showAvatar, List<String> excludeUsers)
      Returns a list of users matching query with highlighting. This resource cannot be accessed anonymously.
      Parameters:
      query - A string used to search username, Name or e-mail address. Empty query is not allowed.
      maxResults - The maximum number of users to return (defaults to 50). The maximum allowed value is 100 (The combination of maxResults and startAt is limited to the first 100 results). If you specify a value that is higher than this number, your search results will be truncated if you send a request with startAt=98 and maxResults=20, it will only return 2 users.
      showAvatar - get avatar url
      excludeUsers - exclude these users from search results
      Returns:
      An object containing list of matched user objects, with html representing highlighting.
    • findUsersAsBean

      UserPickerResultsBean findUsersAsBean(String query, Integer maxResults, Boolean showAvatar, List<String> excludeUsers, UserSearchParams userSearchParams)
      Returns a list of users matching query with highlighting. This resource cannot be assessed anonymously.
      Parameters:
      query - A string used to search username, Name or e-mail address. Empty query is not allowed.
      maxResults - The maximum number of users to return (defaults to 50). The maximum allowed value is 100 (The combination of maxResults and startAt is limited to the first 100 results). If you specify a value that is higher than this number, your search results will be truncated if you send a request with startAt=98 and maxResults=20, it will only return 2 users.
      showAvatar - get avatar url
      excludeUsers - exclude these users from search results
      userSearchParams - additional search parameters. allowEmptyQuery is ignored, always treated as false.
      Returns:
      An object containing list of matched user objects, with html representing highlighting.
      Since:
      v6.1
    • limitUserSearch

      List<ApplicationUser> limitUserSearch(Integer startAt, Integer maxResults, Iterable<ApplicationUser> users, @Nullable Iterable<String> excludeUsers)
      Parameters:
      startAt - start the search at this index
      maxResults - max results
      users - search results to limit
      excludeUsers - exclude these users from search results
      Returns:
      adjusted search results
    • findActiveUsers

      List<ApplicationUser> findActiveUsers(String searchString)
      Finds active users, throws exception if search string is null
      Parameters:
      searchString - user query
      Returns:
      List of matching users
    • findUsers

      List<ApplicationUser> findUsers(String searchString, Boolean includeActive, Boolean includeInactive)
      Finds users, throws exception if search string is null
      Parameters:
      searchString - user query, no users returned if empty
      includeActive - whether to include active users (null implies true)
      includeInactive - whether to include inactive users (null implies false)
      Returns:
      List of matching users
    • findUsers

      List<ApplicationUser> findUsers(String searchString, UserSearchParams userSearchParams)
      Finds users, throws exception if search string is null
      Parameters:
      searchString - user query
      userSearchParams - search parameters, including "includeActive", "includeInactive", etc. allowEmptyQuery is ignored, always treated as false.
      Returns:
      List of matching users
    • findUsers

      List<ApplicationUser> findUsers(String searchString, Boolean includeActive, Boolean includeInactive, boolean allowEmptySearchString)
      Finds users, throws exception if search string is null
      Parameters:
      searchString - user query
      includeActive - whether to include active users (null implies true)
      includeInactive - whether to include inactive users (null implies false)
      allowEmptySearchString - controls whether users are returned if searchString is empty
      Returns:
      List of matching users
    • findUsers

      List<ApplicationUser> findUsers(String searchString, Boolean includeActive, Boolean includeInactive, boolean allowEmptySearchString, com.google.common.base.Predicate<com.atlassian.crowd.embedded.api.User> filter)
      Finds users, throws exception if search string is null
      Parameters:
      searchString - user query
      includeActive - whether to include active users (null implies true)
      includeInactive - whether to include inactive users (null implies false)
      allowEmptySearchString - controls whether users are returned if searchString is empty
      filter - filter to post-process user results with. May be null for no filtering.
      Returns:
      List of matching users
    • findUsers

      List<ApplicationUser> findUsers(String searchString, Boolean includeActive, Boolean includeInactive, boolean allowEmptySearchString, com.google.common.base.Predicate<com.atlassian.crowd.embedded.api.User> filter, Integer maxResults)
      Finds users, throws exception if search string is null
      Parameters:
      searchString - user query
      includeActive - whether to include active users (null implies true)
      includeInactive - whether to include inactive users (null implies false)
      allowEmptySearchString - controls whether users are returned if searchString is empty
      filter - filter to post-process user results with. May be null for no filtering.
      maxResults - the result limit, use null for no limit.
      Returns:
      List of matching users
    • findUsersWithBrowsePermission

      List<ApplicationUser> findUsersWithBrowsePermission(String searchString, UserSearchIssueContext issueContext, Integer maxResults, boolean ignorePermissionCheck)
      Finds users with browse permission, throws exception if search string is null
      Parameters:
      searchString - user query
      issueContext - context for issue
      maxResults - the result limit, use null for no limit.
      ignorePermissionCheck - controls if user making call must have Browse User permission
      Returns:
      List of matching users
    • findTopAssignableUsers

      List<ApplicationUser> findTopAssignableUsers(String searchString, UserSearchIssueContext issueContext, Integer maxResults, boolean ignorePermissionCheck)
      Finds top maxResults assignable users
      Parameters:
      searchString - user query
      issueContext - context for issue
      maxResults - the result limit, use null for no limit
      ignorePermissionCheck - controls if user making call must have Browse User permission
      Returns:
      List of matching users
    • getUserByName

      ApplicationUser getUserByName(String userName)
      Returns a user if supplied userName is exact match to their username.
      Parameters:
      userName - The username query
      Returns:
      User The exact user or null if not found.