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.MultiGroupCFType

Class Overview

Multiple User Group Select Type

Transport Object Type
java.util.Collection of Groups
Singular Object Type
Group
Database Storage Type
String of group name

Summary

Nested Classes
interface MultiGroupCFType.Visitor<T>  
[Expand]
Inherited Constants
From interface com.atlassian.jira.issue.customfields.CustomFieldType
Fields
protected final MultiGroupConverter multiGroupConverter
[Expand]
Inherited Fields
From class com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType
Public Constructors
MultiGroupCFType(CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager, MultiGroupConverter multiGroupConverter, PermissionManager permissionManager, JiraAuthenticationContext authenticationContext, GroupManager groupManager, FieldVisibilityManager fieldVisibilityManager, JiraBaseUrls jiraBaseUrls)
Public Methods
Object accept(VisitorBase visitor)
int compare(String customFieldObjectValue1, String customFieldObjectValue2, FieldConfig fieldConfig)
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.
Query getQueryForGroup(String fieldName, String groupName)
This method should be implemented in your custom type to return a Query.
List<FieldIndexer> 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.
Group getSingularObjectFromString(String s)
String getStringFromSingularObject(Group o)
Object getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Collection<Group> 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).
boolean isMultiple()
void validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config)
Protected Methods
Group convertDbValueToType(Object dbValue)
Converts a given db value to Single form of Transport Object
Object convertTypeToDbValue(Group value)
Converts a given underlying type to its db storage value.
@Nonnull PersistenceFieldType getDatabaseType()
Type of database field needed to store this field.
Comparator<Group> 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.GroupSelectorField
From interface com.atlassian.jira.issue.customfields.SortableCustomField
From interface com.atlassian.jira.issue.fields.rest.RestAwareCustomFieldType
From interface com.atlassian.jira.issue.fields.rest.RestCustomFieldTypeOperations

Fields

protected final MultiGroupConverter multiGroupConverter

Public Constructors

public MultiGroupCFType (CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager, MultiGroupConverter multiGroupConverter, PermissionManager permissionManager, JiraAuthenticationContext authenticationContext, GroupManager groupManager, FieldVisibilityManager fieldVisibilityManager, JiraBaseUrls jiraBaseUrls)

Public Methods

public Object accept (VisitorBase visitor)

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

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 Query getQueryForGroup (String fieldName, String groupName)

This method should be implemented in your custom type to return a Query. Generally you should return a TermQuery in the form of fieldName:groupName. However some custom fields, such as (@Link SelectCFType) manipulate the field identifiers and values before storing in the index. In cases like this you will have to implement the method such that it searches the correct fields.

Parameters
fieldName the id of the custom field
groupName the name of the group to filter on
Returns
  • the (@Link Query) to pass to the searcher

public List<FieldIndexer> 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 Group getSingularObjectFromString (String s)

public String getStringFromSingularObject (Group o)

public Object getStringValueFromCustomFieldParams (CustomFieldParams parameters)

public Collection<Group> 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 boolean isMultiple ()

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

Protected Methods

protected Group convertDbValueToType (Object dbValue)

Converts a given db value to Single form of Transport Object

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

protected Object convertTypeToDbValue (Group 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<Group> 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