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

Class Overview

Custom Field Type to select a Project on this JIRA instance.

Transport Object Type
GenericValue
Database Storage Type
Long of Project ID

Summary

Nested Classes
interface ProjectCFType.Visitor<T>  
[Expand]
Inherited Constants
From class com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType
From interface com.atlassian.jira.issue.customfields.CustomFieldType
[Expand]
Inherited Fields
From class com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType
Public Constructors
ProjectCFType(CustomFieldValuePersister customFieldValuePersister, ProjectConverter projectConverter, PermissionManager permissionManager, JiraAuthenticationContext jiraAuthenticationContext, GenericConfigManager genericConfigManager, JiraBaseUrls jiraBaseUrls, ProjectManager projectManager)
Public Methods
Object accept(VisitorBase visitor)
int compare(GenericValue customFieldObjectValue1, GenericValue customFieldObjectValue2, FieldConfig fieldConfig)
String getChangelogString(CustomField field, GenericValue 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.
@Nonnull List<FieldConfigItemType> getConfigurationItemTypes()
Returns a List of FieldConfigItemType objects.
FieldTypeInfo getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
Returns lower level Information about the 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.
GenericValue getSingularObjectFromString(String string)
String getStringFromSingularObject(GenericValue customFieldObject)
@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).
Protected Methods
@Nonnull PersistenceFieldType getDatabaseType()
Type of database field needed to store this field.
Object getDbValueFromObject(GenericValue customFieldObject)
Returns the database representation of the Java object as stored for that CustomField.
GenericValue getObjectFromDbValue(Object databaseValue)
Returns the Transport Object for the given Custom Field value as represented by the value stored in the database
[Expand]
Inherited Methods
From class com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType
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 ProjectCFType (CustomFieldValuePersister customFieldValuePersister, ProjectConverter projectConverter, PermissionManager permissionManager, JiraAuthenticationContext jiraAuthenticationContext, GenericConfigManager genericConfigManager, JiraBaseUrls jiraBaseUrls, ProjectManager projectManager)

Public Methods

public Object accept (VisitorBase visitor)

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

public String getChangelogString (CustomField field, GenericValue 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.

@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 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 GenericValue getSingularObjectFromString (String string)

public String getStringFromSingularObject (GenericValue customFieldObject)

@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)

Protected Methods

@Nonnull protected PersistenceFieldType getDatabaseType ()

Type of database field needed to store this field.

Returns

protected Object getDbValueFromObject (GenericValue customFieldObject)

Returns the database representation of the Java object as stored for that CustomField. (eg. ProjectId if the Value represents a project). Must be compatable with type returned by getDatabaseType()

Parameters
customFieldObject the Transport Object
Returns
  • String, Double or Date

protected GenericValue getObjectFromDbValue (Object databaseValue)

Returns the Transport Object for the given Custom Field value as represented by the value stored in the database

Parameters
databaseValue - String, Double or Date objects as returned from getDbValueFromObject(Object)
Returns
  • Domain object or GenericValue