public class DefaultAssigneeService extends Object implements AssigneeService
AssigneeService
.Constructor and Description |
---|
DefaultAssigneeService(PermissionContextFactory permissionContextFactory,
PermissionSchemeManager permissionSchemeManager,
UserHistoryManager userHistoryManager,
FeatureManager featureManager,
JiraAuthenticationContext authenticationContext,
UserKeyService userKeyService,
UserManager userManager,
PermissionManager permissionManager) |
Modifier and Type | Method and Description |
---|---|
Collection<ApplicationUser> |
findAssignableUsers(String query,
Issue issue,
com.opensymphony.workflow.loader.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,
com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
Get all
ApplicationUser s that may have all of the given Issue s assigned to them, for a
given workflow state. |
List<ApplicationUser> |
getAssignableUsers(Issue issue,
com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
Get all
ApplicationUser s that may have an Issue assigned to them, for a given workflow state. |
Set<String> |
getRecentAssigneeKeysForIssue(Issue issue)
Gets ids of this issue's recent assignees, including the current assignee.
|
Set<String> |
getRecentAssigneeKeysForUser(ApplicationUser remoteUser)
Get users keys that the given user has recently assigned issues to.
|
Set<String> |
getRecentAssigneeNamesForIssue(Issue issue)
Gets the names of this issue's recent assignees, including the current assignee.
|
Set<String> |
getRecentAssigneeNamesForUser(ApplicationUser remoteUser)
Get users names that the given user has recently assigned issues to.
|
List<ApplicationUser> |
getSuggestedAssignees(Issue issue,
ApplicationUser loggedInUser,
com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
Returns a list of suggested Assignee
ApplicationUser s for a given Issue and logged-in com.atlassian.jira.user.ApplicationUser. |
List<ApplicationUser> |
getSuggestedAssignees(Issue issue,
ApplicationUser loggedInUser,
List<ApplicationUser> assignableUsers)
Returns a list of suggested Assignee
ApplicationUser s for a given Issue and logged-in com.atlassian.jira.user.ApplicationUser. |
List<ApplicationUser> |
getSuggestedAssignees(Set<String> suggestedAssigneeNames,
List<ApplicationUser> assignableUsers)
Given a set of suggested names and an ordered list of assignable users, returns an order list of suggested users.
|
boolean |
isAssignable(Issue issue,
ApplicationUser user,
com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
Determines if a user is assignable to an issue.
|
boolean |
isAssignable(Project project,
ApplicationUser user)
Determines if a user is assignable to an issue in a project.
|
Map<String,Boolean> |
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 DefaultAssigneeService(PermissionContextFactory permissionContextFactory, PermissionSchemeManager permissionSchemeManager, UserHistoryManager userHistoryManager, FeatureManager featureManager, JiraAuthenticationContext authenticationContext, UserKeyService userKeyService, UserManager userManager, PermissionManager permissionManager)
public boolean isAssignable(@Nonnull Issue issue, @Nonnull ApplicationUser user, @Nullable com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
AssigneeService
isAssignable
in interface AssigneeService
issue
- the issue.user
- the user to check.public boolean isAssignable(@Nonnull Project project, @Nonnull ApplicationUser user)
AssigneeService
isAssignable
in interface AssigneeService
project
- the project.user
- the user to check.public List<ApplicationUser> getSuggestedAssignees(Issue issue, @Nullable ApplicationUser loggedInUser, @Nullable com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
AssigneeService
ApplicationUser
s for a given Issue and logged-in com.atlassian.jira.user.ApplicationUser.
This version accepts a pre-populated list of assignable Users to filter.
getSuggestedAssignees
in interface AssigneeService
issue
- Issue to get suggested Assignees forloggedInUser
- the user getting the suggestions, whose Assignee history may be queriedactionDescriptor
- workflow action descriptor to filter users onApplicationUser
objects deemed relevant to the given Issue and com.atlassian.jira.user.ApplicationUser, sorted by UserBestNameComparatorpublic List<ApplicationUser> getSuggestedAssignees(Issue issue, ApplicationUser loggedInUser, List<ApplicationUser> assignableUsers)
AssigneeService
ApplicationUser
s for a given Issue and logged-in com.atlassian.jira.user.ApplicationUser.
This version accepts a pre-populated list of assignable Users to filter.
getSuggestedAssignees
in interface AssigneeService
issue
- Issue to get suggested Assignees forloggedInUser
- the user getting the suggestions, whose Assignee history may be queriedassignableUsers
- a list of ApplicationUser
s to filterApplicationUser
objects deemed relevant to the given Issue and com.atlassian.jira.user.ApplicationUser.public Collection<ApplicationUser> findAssignableUsers(String query, Issue issue, @Nullable com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
AssigneeService
Matches on the start of username, Each word in Full Name & email.
Results are sorted according to the UserCachingComparator
.
findAssignableUsers
in interface AssigneeService
query
- String to search for.issue
- Issue to check Assignee permissions againstactionDescriptor
- an ActionDescriptor
describing the context in which the Assignee is being searchedApplicationUser
objects that match criteria.public Collection<ApplicationUser> findAssignableUsers(String query, Project project)
AssigneeService
Matches on the start of username, Each word in Full Name & email.
Results are sorted according to the UserCachingComparator
.
findAssignableUsers
in interface AssigneeService
query
- String to search for.project
- Project check Assignee permissions againstApplicationUser
objects that match criteria.public List<ApplicationUser> getSuggestedAssignees(Set<String> suggestedAssigneeNames, List<ApplicationUser> assignableUsers)
getSuggestedAssignees
in interface AssigneeService
suggestedAssigneeNames
- the names of the users to returnassignableUsers
- a list of Users to filter by the suggested assignee namespublic List<ApplicationUser> getAssignableUsers(Issue issue, com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
AssigneeService
ApplicationUser
s 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.
getAssignableUsers
in interface AssigneeService
issue
- the Issue to find assignable users foractionDescriptor
- workflow action descriptor to filter users onpublic List<ApplicationUser> getAssignableUsers(Collection<Issue> issues, com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
AssigneeService
ApplicationUser
s that may have all of the given Issue
s 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 AssigneeService.getAssignableUsers(Issue, ActionDescriptor)
,
but returns only those users that are assignable for all of the issues. This is
significantly more efficient than calling AssigneeService.getAssignableUsers(Issue, ActionDescriptor)
multiple times and filtering the lists yourself.
getAssignableUsers
in interface AssigneeService
issues
- the Issues to find assignable users foractionDescriptor
- workflow action descriptor to filter users onpublic Set<String> getRecentAssigneeKeysForIssue(Issue issue)
getRecentAssigneeKeysForIssue
in interface AssigneeService
issue
- an issue to get the change history ofAssigneeService.getRecentAssigneeNamesForIssue(com.atlassian.jira.issue.Issue)
public Set<String> getRecentAssigneeNamesForIssue(Issue issue)
getRecentAssigneeNamesForIssue
in interface AssigneeService
issue
- an issue to get the change history ofAssigneeService.getRecentAssigneeKeysForIssue(com.atlassian.jira.issue.Issue)
public Map<String,Boolean> makeUniqueFullNamesMap(Collection<ApplicationUser> users)
AssigneeService
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.
makeUniqueFullNamesMap
in interface AssigneeService
users
- a collection of Users that may contain multiple users with the same full namepublic Set<String> getRecentAssigneeNamesForUser(ApplicationUser remoteUser)
getRecentAssigneeNamesForUser
in interface AssigneeService
remoteUser
- a ApplicationUserpublic Set<String> getRecentAssigneeKeysForUser(ApplicationUser remoteUser)
getRecentAssigneeKeysForUser
in interface AssigneeService
remoteUser
- a ApplicationUserCopyright © 2002-2015 Atlassian. All Rights Reserved.