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

Class Overview

Custom Field Type to select multiple Versions.

Transport Object Type
Collection of Versions
Singular Object Type
Version
Database Storage Type
Long of the Version's id

Summary

Nested Classes
enum VersionCFType.VersionOrder An enum representing orders can be choosed to affect the order of versions group displayed on version picker custom field  
interface VersionCFType.Visitor<X>  
[Expand]
Inherited Constants
From interface com.atlassian.jira.issue.customfields.CustomFieldType
[Expand]
Inherited Fields
From class com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType
Public Constructors
VersionCFType(PermissionManager permissionManager, JiraAuthenticationContext jiraAuthenticationContext, VersionManager versionManager, CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager, VersionHelperBean versionHelperBean, JiraBaseUrls jiraBaseUrls)
Public Methods
Object accept(VisitorBase visitor)
String availableForBulkEdit(BulkEditBean bulkEditBean)
Allow the custom field type perform a specific check as to its availability for bulk editing.
int compare(Object customFieldObjectValue1, Object customFieldObjectValue2, FieldConfig fieldConfig)
String getChangelogString(CustomField field, Collection<Version> versions)
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.
@Nonnull List<FieldConfigItemType> getConfigurationItemTypes()
Returns a List of FieldConfigItemType objects.
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.
RestFieldOperationsHandler getRestFieldOperation(CustomField field)
Returns the RestFieldOperationsHandler for this field.
Version getSingularObjectFromString(String string)
String getStringFromSingularObject(Version version)
Object getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Collection<Version> 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
Version convertDbValueToType(Object input)
Converts a given db value to Single form of Transport Object
Object convertTypeToDbValue(Version value)
Converts a given underlying type to its db storage value.
@Nonnull PersistenceFieldType getDatabaseType()
Type of database field needed to store this field.
Comparator<Version> 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.RestAwareCustomFieldType
From interface com.atlassian.jira.issue.fields.rest.RestCustomFieldTypeOperations

Public Constructors

public VersionCFType (PermissionManager permissionManager, JiraAuthenticationContext jiraAuthenticationContext, VersionManager versionManager, CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager, VersionHelperBean versionHelperBean, JiraBaseUrls jiraBaseUrls)

Public Methods

public Object accept (VisitorBase visitor)

public String availableForBulkEdit (BulkEditBean bulkEditBean)

Allow the custom field type perform a specific check as to its availability for bulk editing.

Parameters
bulkEditBean BulkEditBean
Returns
  • null if available for bulk edit or appropriate unavailable message

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

public String getChangelogString (CustomField field, Collection<Version> versions)

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
versions Transport Object representing the value instance of the CustomField
Returns
  • Change log string.

@Nonnull public List<FieldConfigItemType> getConfigurationItemTypes ()

Returns a List of FieldConfigItemType objects. Can not be immutable. This opens up possibilities for configurable custom fields.

Returns

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 RestFieldOperationsHandler getRestFieldOperation (CustomField field)

Returns the RestFieldOperationsHandler for this field.

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

public Version getSingularObjectFromString (String string)

public String getStringFromSingularObject (Version version)

public Object getStringValueFromCustomFieldParams (CustomFieldParams parameters)

public Collection<Version> 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 Version convertDbValueToType (Object input)

Converts a given db value to Single form of Transport Object

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

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