java.lang.Object | |
↳ | com.atlassian.jira.issue.fields.CustomFieldImpl |
Known Direct Subclasses |
Default CustomField implementation backed by the database (a GenericValue object). Usually managed via CustomFieldManager
.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.atlassian.jira.issue.fields.CustomField
| |||||||||||
From interface com.atlassian.jira.issue.fields.NavigableField | |||||||||||
From interface
com.atlassian.jira.issue.fields.OrderableField
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Checks if custom field is available for bulk edit operation, whether 'shown' and if user has bulk update
permission.
| |||||||||||
Returns
true if a call to removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)
will actually remove the value. | |||||||||||
This method compares the values of this custom field in two given issues.
| |||||||||||
Return
SearchHandler for the field. | |||||||||||
Returns a list of issue types associated with this custom field.
| |||||||||||
Returns a list of issue types associated with this custom field.
| |||||||||||
Returns a list of projects associated with this custom field.
| |||||||||||
Returns HTML that should be shown when the issue is being bulk edited.
| |||||||||||
Return the JQL clause names that this custom field should be recognized by.
| |||||||||||
Returns a List of
FieldConfigItemType objects. | |||||||||||
Returns a list of configuration schemes.
| |||||||||||
Returns the HTML that should be shown when the issue is being created.
| |||||||||||
Returns the HTML that should be shown when the issue is being created.
| |||||||||||
Retrieves the
CustomFieldSearcher for this custom field looking it up in the customFieldManager by the
searcher key retrieved from ENTITY_CUSTOM_FIELD_SEARCHER underlying generic value attribute. | |||||||||||
Looks up the
CustomFieldType in the #customFieldTypeModuleDescriptors by the key retrieved from the ENTITY_CF_TYPE_KEY attribute of the
underlying generic value. | |||||||||||
Get the custom field string values that are relevant to this particular custom field
| |||||||||||
Returns
ORDER_ASCENDING . | |||||||||||
The value that should be set on the issue if the field is not shown for some reason.
| |||||||||||
Returns the i18n'ed description of this custom field.
| |||||||||||
Returns a
RenderableProperty for rendering this custom field's description. | |||||||||||
Returns HTML that should be shown when the issue is being edited.
| |||||||||||
Returns HTML that should be shown when the issue is being edited.
| |||||||||||
Returns the title of this custom field.
| |||||||||||
Returns lower level Information about the field.
| |||||||||||
Returns a generic value that represents this custom field.
| |||||||||||
Returns the id of the field to check for visibility.
| |||||||||||
Returns the identifier for this RenderableField.
| |||||||||||
Returns ID of this custom field.
| |||||||||||
Return The default data for this system field.
| |||||||||||
Return a 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.
| |||||||||||
Return a description of the shape of this field when represented as JSON.
| |||||||||||
Returns the name of this custom field.
| |||||||||||
The i18n key that is used to lookup the field's name when it is displayed
| |||||||||||
Returns options for this custom field if it is of
MultipleCustomFieldType type. | |||||||||||
Returns options for this custom field if it is of
MultipleCustomFieldType type. | |||||||||||
Name of the parameter that stores the issue id in the current context in CustomFieldParams.
| |||||||||||
Name of the parameter that stores the project id of the associated issue in the current context in
CustomFieldParams.
| |||||||||||
Returns a relevant
FieldConfig for the given issue. | |||||||||||
Returns the relevant field config of this custom field for the give issue context
| |||||||||||
Return the relevant field config for the search context specified.
| |||||||||||
Return a SortComparatorSource that uses either a custom field searcher that implements
SortableCustomFieldSearcher or a custom field that implements SortableCustomField . | |||||||||||
Return a list of Lucene SortFields to be used for sorting search results.
| |||||||||||
If this field has a searcher, and this searcher implements
SortableCustomFieldSearcher then return getSorter(CustomField) . | |||||||||||
Returns the description of this custom field by reading
ENTITY_DESCRIPTION of the underlying generic
value. | |||||||||||
Returns a
RenderableProperty for rendering this custom field's description. | |||||||||||
Returns the name of this custom field by reading
ENTITY_NAME of the underlying generic value. | |||||||||||
Retrieves and returns the Object representing the this CustomField value for the given issue.
| |||||||||||
Gets the value stored for this field on the provided issue.
| |||||||||||
Get a field value from the map of parameters passed.
| |||||||||||
Determines if the field has a value for the given issue.
| |||||||||||
Returns true if it applies for all issue types, false otherwise.
| |||||||||||
Checks whether this custom field applies for all projects.
| |||||||||||
Returns true if this custom field has an edit template, false otherwise.
| |||||||||||
Returns true if all configuration schemes returned by
getConfigurationSchemes() are enabled. | |||||||||||
Returns true if this custom field applies for all projects and all issue types.
| |||||||||||
Determines if this custom field is within the scope of the given project, and list of Issue Types.
| |||||||||||
Determines if this custom field is within the scope of the given project, and Issue Type.
| |||||||||||
Determines whether this custom field is in scope.
| |||||||||||
Determines if this custom field is within the scope of the given project, and list of Issue Types.
| |||||||||||
Returns true if the custom field has a config for the Project and Issue Type of the given IssueContext.
| |||||||||||
This is the conjunction point with CustomFieldTypes and this is delegated off to customField Types.
| |||||||||||
Tests field specific way to determine if it should be shown or not.
| |||||||||||
Used to determine if the field needs input from user to be moved to the new project and/or issue type.
| |||||||||||
Populate the fieldValueHolder with a value that should be shown by default when the issue
has not been created yet.
| |||||||||||
Used to populate the fieldValueHolder with parameters for move issue screen.
| |||||||||||
Puts the custom field parameters retrieved from the given issue to the given customFieldValuesHolder map.
| |||||||||||
Puts the relevant parameters from the given params map to the given customFieldValuesHolder map.
| |||||||||||
Does nothing.
| |||||||||||
Returns the same string.
| |||||||||||
Returns the same string.
| |||||||||||
Removes this custom field and returns a set of issue IDs of all issues that are affected by removal of this
custom field.
| |||||||||||
Removes the field value from the given MutableIssue object.
| |||||||||||
Record the value on the issue (not saving it to the database, see updateValue).
| |||||||||||
Update the issue in the data store.
| |||||||||||
Validates relevant parameters on custom field type of this custom field.
| |||||||||||
Ensure that the parameters are valid
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Compare two objects - return false if both are null or equal.
| |||||||||||
Non-public method that returns a copy of the underlying GenericValue.
| |||||||||||
Overridable location to retrieve an EventPublisher to publish events through.
| |||||||||||
Returns custom field parameter from the given map that are relevant to this custom field.
| |||||||||||
Checks whether the user has the permission to execute the bulk operation for the provided issue.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.jira.issue.fields.ConfigurableField
| |||||||||||
From interface
com.atlassian.jira.issue.fields.CustomField
| |||||||||||
From interface
com.atlassian.jira.issue.fields.Field
| |||||||||||
From interface com.atlassian.jira.issue.fields.NavigableField | |||||||||||
From interface
com.atlassian.jira.issue.fields.OrderableField
| |||||||||||
From interface
com.atlassian.jira.issue.fields.SearchableField
| |||||||||||
From interface
com.atlassian.jira.issue.fields.renderer.RenderableField
| |||||||||||
From interface
com.atlassian.jira.issue.fields.rest.RestAwareField
| |||||||||||
From interface
com.atlassian.jira.issue.fields.rest.RestFieldOperations
| |||||||||||
From interface
java.lang.Comparable
|
Checks if custom field is available for bulk edit operation, whether 'shown' and if user has bulk update permission. Also checks that all selected issues have the same field config for this custom field. All field configs must be the same or all null.
bulkEditBean | bulk edit bean |
---|
Returns true
if a call to removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)
will actually remove the value.
There a few different reasons why this method may return false:
issue | The Issue object. |
---|
true
if a call to removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)
will actually remove the value.This method compares the values of this custom field in two given issues.
Returns a negative integer, zero, or a positive integer as the value of first issue is less than, equal to, or greater than the value of the second issue. This method returns 0 if this custom field is not sortable, or its customFieldType is not an instance ofSortableCustomField
If either of given issues is null a IllegalArgumentException is thrown.issue1 | issue to compare |
---|---|
issue2 | issue to compare |
IllegalArgumentException | if any of given issues is null |
---|
Return SearchHandler
for the field. This object tells JIRA how to search for values within the field.
null
when no searcher
is associated with the field. This will mainly happen when a customfield is configured to have no
searcher.
Returns a list of issue types associated with this custom field. Will be null if the field is global
Returns a list of issue types associated with this custom field. Will be null if the field is global
Returns a list of projects associated with this custom field. Will be null if the field is global
Returns HTML that should be shown when the issue is being bulk edited.
operationContext | OperationContext |
---|---|
action | Action |
bulkEditBean | BulkEditBean |
displayParameters | Map of display parameters. |
Return the JQL clause names that this custom field should be recognized by.
Returns a List of FieldConfigItemType
objects. This opens up possibilties for configurable custom fields
FieldConfigItemType
@Nonnull
Returns a list of configuration schemes.
FieldConfigScheme
objects
Returns the HTML that should be shown when the issue is being created.
fieldLayoutItem | FieldLayoutItem |
---|---|
operationContext | OperationContext |
action | Action |
issue | Issue |
dispayParameters | Map of display parameters. |
Returns the HTML that should be shown when the issue is being created.
fieldLayoutItem | FieldLayoutItem |
---|---|
operationContext | OperationContext |
action | Action |
issue | Issue |
Retrieves the CustomFieldSearcher
for this custom field looking it up in the customFieldManager by the
searcher key retrieved from ENTITY_CUSTOM_FIELD_SEARCHER
underlying generic value attribute. The
seracher, if found is initialized with this custom field before it is returned.
Looks up the CustomFieldType
in the #customFieldTypeModuleDescriptors by the key retrieved from the ENTITY_CF_TYPE_KEY
attribute of the
underlying generic value. This only happens once if #typeRef is null, then the custom field type is set
and returned each time. It can return null if the custom field type cannot be found by that key.
Get the custom field string values that are relevant to this particular custom field
customFieldValuesHolder | containing all params |
---|
CustomFieldParams
of String
objects
Returns ORDER_ASCENDING
.
ORDER_ASCENDING
value
The value that should be set on the issue if the field is not shown for some reason.
For example: The user does not have permission to see the field, or the field is not part of the create screen.
issue | the Issue. |
---|
Returns the i18n'ed description of this custom field.
Returns a RenderableProperty
for rendering this custom field's description.
Returns HTML that should be shown when the issue is being edited.
fieldLayoutItem | FieldLayoutItem |
---|---|
operationContext | OperationContext |
action | Action |
issue | Issue |
dispayParameters | Map of display parameters. |
Returns HTML that should be shown when the issue is being edited.
fieldLayoutItem | FieldLayoutItem |
---|---|
operationContext | OperationContext |
action | Action |
issue | Issue |
Returns the title of this custom field.
Returns lower level Information about the field. This information contains allowed values and/or the autocomplete url
fieldTypeInfoContext | the FieldTypeInfoContext contains context information that is relevant to generate the FieldTypeInfo
|
---|
Returns a generic value that represents this custom field. (only for internal use, it is deprecated on interface)
Returns the id of the field to check for visibility. For example, with original estimate field need to ensure that the timetracking field is not hidden. With most fields, this is the same as their id.
Returns the identifier for this RenderableField.
Return The default data for this system field. May be null if there is no default.
issueCtx | Issue (This should really only need to be an issue context, but for historical reasons we need an issue object. |
---|
Return a 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.
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. Will only be supplied if the field is also an ordereable field. |
Return a description of the shape of this field when represented as JSON.
Returns the name of this custom field.
The i18n key that is used to lookup the field's name when it is displayed
Returns options for this custom field if it is of MultipleCustomFieldType
type. Otherwise returns null.
key | not used |
---|---|
config | relevant field config |
contextNode | JIRA context node |
MultipleCustomFieldType
type, null otherwise
Returns options for this custom field if it is of MultipleCustomFieldType
type. Otherwise returns null.
key | not used |
---|---|
jiraContextNode | JIRA context node |
MultipleCustomFieldType
type, null otherwise
Name of the parameter that stores the issue id in the current context in CustomFieldParams. This is useful for getting data such as the previous value.
Name of the parameter that stores the project id of the associated issue in the current context in CustomFieldParams.
Returns a relevant FieldConfig
for the given issue. If the field has
a config for the issue then one will be returned, otherwise null is returned.
For example, if we have 2 projects: project A and project B, and a custom field is configured to be only applicable to project A, calling getRelevantConfig with an issue from project A should return the config (i.e. not null). Calling this method with an issue from project B should return null.
issue | issue whose project and issue type will be used to check if the field has a config |
---|
FieldConfig
representing the configuration of the field for issue's
project/issue type. If the field does not have a config for issue's project/issue type, null is returned.Returns the relevant field config of this custom field for the give issue context
issueContext | issue context to find the relevant field config for |
---|
Return the relevant field config for the search context specified. Checks that all configs within search context are the same - i.e. all null or all the same config.
Returns null if any two configs are different. Note: null config is not equal to non-null config. Previously, a non-null config was returned even if the first config(s) was null.searchContext | search context |
---|
Return a SortComparatorSource that uses either a custom field searcher that implements SortableCustomFieldSearcher
or a custom field that implements SortableCustomField
. If neither are found,
this method returns null.
Return a list of Lucene SortFields to be used for sorting search results.
Using this method allows the field to specify the most performant way to perform a search. If a field can be sorted directly using the term in the index then this should just return a singleton list with the sort field.
return Collections.singletonList(new SortField(fieldName, sortOrder));
The default implementation builds this using the FieldComparatorSource returned by getSortComparatorSource()
If you implement this method there is no need to implement getSortComparatorSource()
.
If this field has a searcher, and this searcher implements SortableCustomFieldSearcher
then return getSorter(CustomField)
. Else return null.
getSortComparatorSource()
Returns the description of this custom field by reading ENTITY_DESCRIPTION
of the underlying generic
value.
Returns a RenderableProperty
for rendering this custom field's description.
Returns the name of this custom field by reading ENTITY_NAME
of the underlying generic value.
Retrieves and returns the Object representing the this CustomField value for the given issue. See getValueFromIssue(CustomField, Issue)
issue | issue to retrieve the value from |
---|
Gets the value stored for this field on the provided issue.
issue | identifies the issue that will contain the value for this field. |
---|
Get a field value from the map of parameters passed. The params map may contain other parameters that are not relevant to this custom field.
params | the map of parameters. |
---|
FieldValidationException |
---|
Determines if the field has a value for the given issue.
issue | the Issue. |
---|
Returns true if it applies for all issue types, false otherwise. The actual check test if the list returned by
getAssociatedIssueTypes()
contains null - all issue types.
Checks whether this custom field applies for all projects. It returns true if it applies for all projects for any field configuration scheme, false otherwise.
Returns true if this custom field has an edit template, false otherwise.
Returns true if all configuration schemes returned by getConfigurationSchemes()
are enabled.
Returns true if this custom field applies for all projects and all issue types.
Determines if this custom field is within the scope of the given project, and list of Issue Types.
project | The project. |
---|---|
issueTypeIds | A list of IssueType ids. |
true
if this custom field is within the given scope.
Determines if this custom field is within the scope of the given project, and Issue Type.
projectId | The project. |
---|---|
issueTypeId | The issueTypeId |
true
if this custom field is within the given scope.Determines whether this custom field is in scope.
searchContext | search context |
---|
Determines if this custom field is within the scope of the given project, and list of Issue Types.
If the project is null, then it is treated as any project. If the issueTypeIds list is null or an empty list, then it is treated as any issue type.
If the passed project is any project, this method will search in all the FieldConfigScheme
of this custom field, ignoring the projects that they apply to (since the given project is any)
and looking for at least one of them that applies to at least one of the given issue type ids.
If the passed list of issue types is any issue type, this method will search for at least one FieldConfigScheme
that applies to the given project, ignoring the issue types that it applies to (since the given issue type ids are any).
If both the project and issue types are any, the question being asked is "is this custom field in the scope of any project and any issue type?", which will always be true.
Returns true if the custom field has a config for the Project and Issue Type of the given IssueContext.
This is equivalent to calling
getRelevantConfig(issueContext) != nullbut in general can run faster because it does not have to resolve the actual FieldConfig.
issueContext | IssueContext whose project and issue type will be used to check if the field has a config |
---|
FieldConfig
representing the configuration of the field for issue's
project/issue type. If the field does not have a config for issue's project/issue type, null is returned.This is the conjunction point with CustomFieldTypes and this is delegated off to customField Types.
Tests field specific way to determine if it should be shown or not.
issue | The Issue. |
---|
Used to determine if the field needs input from user to be moved to the new project and/or issue type. This method is called only if the field is visible in the target project/issue type.
originalIssues | Collection of original Issues. |
---|---|
targetIssue | Target Issue. |
targetFieldLayoutItem | FieldLayoutItem |
Populate the fieldValueHolder with a value that should be shown by default when the issue has not been created yet.
customFieldValuesHolder | The fieldValuesHolder Map to be populated. |
---|---|
issue | The Issue. |
Used to populate the fieldValueHolder with parameters for move issue screen.
This field is only called if the issue needs to be updated during move, i.e. needsMove(java.util.Collection, com.atlassian.jira.issue.Issue, com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem)
returned true, and the remote user (the one performing the move) has the permission to actually update this field.
fieldValuesHolder | Map of field Values. |
---|---|
originalIssue | orignal Issue |
targetIssue | target Issue |
Puts the custom field parameters retrieved from the given issue to the given customFieldValuesHolder map.
customFieldValuesHolder | map of custom field values |
---|---|
issue | issue to get the custom field parameters from |
Puts the relevant parameters from the given params map to the given customFieldValuesHolder map.
customFieldValuesHolder | map of custom field values |
---|---|
params | map of parameters |
Does nothing. Throws UnsupportedOperationException.
fieldValuesHolder | not used |
---|---|
stringValue | not used |
issue | not used |
UnsupportedOperationException | always |
---|
Returns the same string.
changeHistory | change history string |
---|---|
i18nHelper | not used |
Returns the same string.
changeHistory | change history string |
---|
Removes this custom field and returns a set of issue IDs of all issues that are affected by removal of this custom field.
DataAccessException |
---|
Removes the field value from the given MutableIssue object.
Note that this operation does not actually persist the change, it just clears the value from the given Issue object. The caller will still need to call #updateValue() in order to persist the change.
Some Fields may choose to quietly ignore this request. eg The SecurityLevel Field will not remove Security Level from subtasks because the subtask must always take the Security Level of its parent issue.
issue | The issue object to be effected. |
---|
Record the value on the issue (not saving it to the database, see updateValue).
fieldLayoutItem | FieldLayoutItem |
---|---|
issue | MutableIssue |
fieldValueHolder | Field Value Holder Map |
Update the issue in the data store.
Fields that are simply stored in the JIRAISSUE DB table, need not do anything here as this table is written to one time to include all fields that changed. Fields using other DB tables must update that table with the appropriate values.
fieldLayoutItem | for this field within this context |
---|---|
issue | Issue this field is part of |
modifiedValue | new value to set field to. Cannot be null. |
issueChangeHolder | an object to record any changes made to the issue by this method. |
Validates relevant parameters on custom field type of this custom field. Any errors found are added to the given
errorCollection. See validateFromParams(CustomFieldParams, ErrorCollection, FieldConfig)
actionParameters | action parameters |
---|---|
errorCollection | error collection to add errors to |
config | field config |
Ensure that the parameters are valid
operationContext | OperationContext |
---|---|
errorCollectionToAddTo | ErrorCollection to add to. |
i18n | I18nHelper |
issue | This is passed to get the value of other fields that may or may not have been modified. |
fieldScreenRenderLayoutItem | FieldScreenRenderLayoutItem |
Compare two objects - return false if both are null or equal. Return true otherwise.
obj1 | the first object to compare |
---|---|
obj2 | the second object to compare |
Non-public method that returns a copy of the underlying GenericValue. This is essentially only used in the above copy constructor.
Prefer this class's get* method instead.Overridable location to retrieve an EventPublisher to publish events through. It's not injected via the constructor because it has too many adverse impacts on APIs and existing usages.
Returns custom field parameter from the given map that are relevant to this custom field.
params | map of parameters |
---|
Checks whether the user has the permission to execute the bulk operation for the provided issue. In case of Bulk Workflow Transition checks for nothing. In case of all others (e.g. Bulk Edit) checks for Edit permission.
bulkEditBean | bulk edit bean |
---|---|
issue | issue to check permission on |