com.atlassian.jira.plugin.assignee.impl
Class DefaultAssigneeResolver

java.lang.Object
  extended by com.atlassian.jira.plugin.assignee.impl.DefaultAssigneeResolver
All Implemented Interfaces:
AssigneeResolver

public class DefaultAssigneeResolver
extends Object
implements AssigneeResolver

The default implementation of AssigneeResolver that is shipped with JIRA. Bases the 'Automatic' assignee reoslution on Project and Component values.


Constructor Summary
DefaultAssigneeResolver(ProjectManager projectManager, JiraAuthenticationContext authenticationContext)
           
 
Method Summary
 com.atlassian.crowd.embedded.api.User getDefaultAssignee(Issue issue, Map fieldValuesHolder)
          Resolves the 'Automatic' assignee based on Project and Component values of the issue
 com.atlassian.crowd.embedded.api.User getDefaultAssigneeObject(Issue issue, Map fieldValuesHolder)
          Determines the default User the issue should be assigned to.
 ErrorCollection validateDefaultAssignee(Issue issue, Map fieldValuesHolder)
          This method is called to validate input when a user selects 'Automatic' during an issue operation, e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAssigneeResolver

public DefaultAssigneeResolver(ProjectManager projectManager,
                               JiraAuthenticationContext authenticationContext)
Method Detail

validateDefaultAssignee

public ErrorCollection validateDefaultAssignee(Issue issue,
                                               Map fieldValuesHolder)
Description copied from interface: AssigneeResolver
This method is called to validate input when a user selects 'Automatic' during an issue operation, e.g. creating, editing, moving an issue, etc.

This method allows the implementation of this interface to validate the input and report any errors back to the caller (most likely the user interface). Most often the errors reported are if the default assignee does not have the Permissions.ASSIGNABLE_USER permission. This method is called before AssigneeResolver.getDefaultAssignee(com.atlassian.jira.issue.Issue, java.util.Map).

The fieldValuesHolder holds values of issue fields that have been selected during the operation. For exmaple, if an issue is being transitioned through workflow and the Screen for the workflow transition shows 3 fields (e.g. description, fix versions, and assignee) the fieldValuesHolder will hold the values of these 3 issue fields. The keys of fieldValuesHolder are issue field ids that can be found in IssueFieldConstants.

Specified by:
validateDefaultAssignee in interface AssigneeResolver
Parameters:
issue - the issue the assignee will be selected for.
fieldValuesHolder - holds values of fields that appear on the Screen of the operation that is being performed. The keys are ids of issue fields. The issue field ids are found in IssueFieldConstants
Returns:
ErrorCollection with errors (if any). Others an empty ErrorCollection is returned.

getDefaultAssignee

public com.atlassian.crowd.embedded.api.User getDefaultAssignee(Issue issue,
                                                                Map fieldValuesHolder)
Resolves the 'Automatic' assignee based on Project and Component values of the issue

Specified by:
getDefaultAssignee in interface AssigneeResolver
Parameters:
issue - the issue the assignee will be selected for.
fieldValuesHolder - is the same as for AssigneeResolver.validateDefaultAssignee(com.atlassian.jira.issue.Issue, java.util.Map). IssueFieldConstants
Returns:
the user the issue should be assigned to.

getDefaultAssigneeObject

public com.atlassian.crowd.embedded.api.User getDefaultAssigneeObject(Issue issue,
                                                                      Map fieldValuesHolder)
Description copied from interface: AssigneeResolver
Determines the default User the issue should be assigned to. This method is invoked when an issue is being created, edited, moved, etc.

When used in GUI operations, this method will be invoked after AssigneeResolver.validateDefaultAssignee(com.atlassian.jira.issue.Issue, java.util.Map). However, it can also be called by itself (eg when creating an issue from an incoming email).

Specified by:
getDefaultAssigneeObject in interface AssigneeResolver
Parameters:
issue - the issue the assignee will be selected for.
fieldValuesHolder - is the same as for AssigneeResolver.validateDefaultAssignee(com.atlassian.jira.issue.Issue, java.util.Map).
Returns:
the user the issue should be assigned to.


Copyright © 2002-2012 Atlassian. All Rights Reserved.