java.lang.Object
   ↳ com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType<T, S>
     ↳ com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType<S>
       ↳ com.atlassian.jira.issue.customfields.impl.MultiUserCFType

Class Overview

Multiple User Type allows selection of multiple users. For single User select use UserCFType

Transport Object Type
Collection
Singular Object Type
ApplicationUser
Database Storage Type
String of user name

Summary

Nested Classes
interface MultiUserCFType.Visitor<T>  
[Expand]
Inherited Constants
From interface com.atlassian.jira.issue.customfields.CustomFieldType
Fields
protected final MultiUserConverter multiUserConverter
[Expand]
Inherited Fields
From class com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType
Public Constructors
MultiUserCFType(CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager, MultiUserConverter multiUserConverter, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, UserPickerSearchService searchService, FieldVisibilityManager fieldVisibilityManager, JiraBaseUrls jiraBaseUrls, EmailFormatter emailFormatter)
Public Methods
Object accept(VisitorBase visitor)
int compare(String customFieldObjectValue1, String customFieldObjectValue2, FieldConfig fieldConfig)
String getChangelogString(CustomField field, Collection<ApplicationUser> value)
Returns a String of representing values to be stored in the change log, an example is the name of a version field that a version id will resolve to within JIRA.
String getChangelogValue(CustomField field, Collection<ApplicationUser> values)
Returns a string representation of the value if not null.
FieldTypeInfo getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
Returns lower level Information about the field.
JsonData getJsonDefaultValue(IssueContext issueCtx, CustomField field)
Return The default data for this system field.
FieldJsonRepresentation getJsonFromIssue(CustomField field, Issue issue, boolean renderedVersionRequested, FieldLayoutItem fieldLayoutItem)
Return a JsonData representation of the field value
JsonType getJsonSchema(CustomField customField)
Return a description of the shape of this field when represented as JSON.
ProjectCustomFieldImporter getProjectImporter()
Returns the object that will perform the actual project import functions for the custom field type.
List getRelatedIndexers(CustomField customField)
Returns a list of indexers that will be used for the field.
RestFieldOperationsHandler getRestFieldOperation(CustomField field)
Returns the RestFieldOperationsHandler for this field.
ApplicationUser getSingularObjectFromString(String s)
String getStringFromSingularObject(ApplicationUser o)
Object getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Collection<ApplicationUser> getValueFromCustomFieldParams(CustomFieldParams parameters)
@Nonnull Map<StringObject> getVelocityParameters(Issue issue, CustomField field, FieldLayoutItem fieldLayoutItem)
The custom field may wish to pass parameters to the velocity context beyond the getValueFromIssue methods (eg managers).
void setLoggedInUser(ApplicationUser loggedInUser)
Explicitly set current session
void updateValue(CustomField customField, Issue issue, Collection<ApplicationUser> value)
Update a multi-select value for an issue.
void validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config)
Protected Methods
ApplicationUser convertDbValueToType(Object string)
Converts a given db value to Single form of Transport Object
Object convertTypeToDbValue(ApplicationUser value)
Converts a given underlying type to its db storage value.
@Nonnull PersistenceFieldType getDatabaseType()
Type of database field needed to store this field.
Comparator<ApplicationUser> getTypeComparator()
Returns a comparator for underlying type of this custom field.
[Expand]
Inherited Methods
From class com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType
From class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType
From class java.lang.Object
From interface com.atlassian.jira.imports.project.customfield.ProjectImportableCustomField
From interface com.atlassian.jira.issue.customfields.CustomFieldType
From interface com.atlassian.jira.issue.customfields.SortableCustomField
From interface com.atlassian.jira.issue.fields.rest.AuthAwareField
From interface com.atlassian.jira.issue.fields.rest.RestAwareCustomFieldType
From interface com.atlassian.jira.issue.fields.rest.RestCustomFieldTypeOperations
From interface com.atlassian.jira.notification.type.UserCFNotificationTypeAware

Fields

protected final MultiUserConverter multiUserConverter

Public Constructors

public MultiUserCFType (CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager, MultiUserConverter multiUserConverter, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, UserPickerSearchService searchService, FieldVisibilityManager fieldVisibilityManager, JiraBaseUrls jiraBaseUrls, EmailFormatter emailFormatter)

Public Methods

public Object accept (VisitorBase visitor)

public int compare (String customFieldObjectValue1, String customFieldObjectValue2, FieldConfig fieldConfig)

public String getChangelogString (CustomField field, Collection<ApplicationUser> value)

Returns a String of representing values to be stored in the change log, an example is the name of a version field that a version id will resolve to within JIRA.

Parameters
field CustomField that the value belongs to
value Transport Object representing the value instance of the CustomField
Returns
  • Change log string.

public String getChangelogValue (CustomField field, Collection<ApplicationUser> values)

Returns a string representation of the value if not null.

Parameters
field not used
values value to create a change log for
Returns
  • string representaion of value if not null, empty string otherwise

public FieldTypeInfo getFieldTypeInfo (FieldTypeInfoContext fieldTypeInfoContext)

Returns lower level Information about the field. This information contains allowed values and/or the autocomplete url

Parameters
fieldTypeInfoContext context information for generating the FieldTypeInfo.
Returns
  • Low level information about the field.

public JsonData getJsonDefaultValue (IssueContext issueCtx, CustomField field)

Return The default data for this system field. May be null if there is no default.

Parameters
issueCtx Issue (This should really only need to be an issue context, but for historical reasons we need an issue object.
field the Custom Field
Returns
  • The default data for this system field.

public FieldJsonRepresentation getJsonFromIssue (CustomField field, Issue issue, boolean renderedVersionRequested, FieldLayoutItem fieldLayoutItem)

Return a JsonData representation of the field value

Parameters
field configuration of the current field
issue to get field data from
renderedVersionRequested whether the use requested the return of rendered/pretty data as well as raw data
fieldLayoutItem field layout for this field.
Returns
  • FieldJsonDataPair containing a json representation of the raw data for this field, and if required, a json representation of the rendered data for easy display.

public JsonType getJsonSchema (CustomField customField)

Return a description of the shape of this field when represented as JSON.

public ProjectCustomFieldImporter getProjectImporter ()

Returns the object that will perform the actual project import functions for the custom field type.

Returns
  • the object that will perform the actual project import functions for the custom field type.

public List getRelatedIndexers (CustomField customField)

Returns a list of indexers that will be used for the field.

Parameters
customField the custom field to get the related indexers of.
Returns
  • List of instantiated and initialised FieldIndexer objects. Null if no related indexers.

public RestFieldOperationsHandler getRestFieldOperation (CustomField field)

Returns the RestFieldOperationsHandler for this field.

Parameters
field the Custom Field
Returns
  • the RestFieldOperationsHandler for this field.

public ApplicationUser getSingularObjectFromString (String s)

public String getStringFromSingularObject (ApplicationUser o)

public Object getStringValueFromCustomFieldParams (CustomFieldParams parameters)

public Collection<ApplicationUser> getValueFromCustomFieldParams (CustomFieldParams parameters)

@Nonnull public Map<StringObject> getVelocityParameters (Issue issue, CustomField field, FieldLayoutItem fieldLayoutItem)

The custom field may wish to pass parameters to the velocity context beyond the getValueFromIssue methods (eg managers).

The values are added to the context for all velocity views (edit, search, view, xml)

Parameters
issue The issue currently in context (Note: this will be null in cases like 'default value')
field CustomField
fieldLayoutItem FieldLayoutItem
Returns
  • A Map of parameters to add to the velocity context, or an empty Map otherwise (never null)

public void setLoggedInUser (ApplicationUser loggedInUser)

Explicitly set current session

public void updateValue (CustomField customField, Issue issue, Collection<ApplicationUser> value)

Update a multi-select value for an issue.

Parameters
customField CustomField for which the value is being stored
issue The Issue.
value Transport Object representing the value instance of the CustomField.

public void validateFromParams (CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config)

Protected Methods

protected ApplicationUser convertDbValueToType (Object string)

Converts a given db value to Single form of Transport Object

Parameters
string db representation as returned by convertTypeToDbValue(Object)
Returns
  • Single form of Transport Object

protected Object convertTypeToDbValue (ApplicationUser value)

Converts a given underlying type to its db storage value. Must be compatable with PersistenceFieldType returned by getDatabaseType()

Parameters
value Single form of Transport Object
Returns
  • database representation of given Transport Object.

@Nonnull protected PersistenceFieldType getDatabaseType ()

Type of database field needed to store this field.

Returns

protected Comparator<ApplicationUser> getTypeComparator ()

Returns a comparator for underlying type of this custom field. Used e.g. for sorting values retrieved from the Database

Returns
  • a comparator, null if can't be compared without extra context