java.lang.Object | |
↳ | com.atlassian.jira.issue.fields.MockCustomField |
Simple implementation of CustomField
for.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Determines whether the field is available for bulk editing given the BulkEditBean.
| |||||||||||
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. | |||||||||||
Looks up the
CustomFieldType . | |||||||||||
Get the custom field string values that are relevant to this particular custom field
| |||||||||||
The order in which to sort the field when it is sorted for the first time.
| |||||||||||
The value that should be set on the issue if the field is not shown for some reason.
| |||||||||||
Returns the 1i8n'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 i18n'ed name of the 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. | |||||||||||
Returns a relevant
FieldConfig for the given issue. | |||||||||||
Returns the relevant field config of this custom field for the give issue context
| |||||||||||
The
FieldConfig that is relevent to all issue contexts in the search context
Checks that all configs within search context are the same - i.e. | |||||||||||
A sortComparatorSource object to be used for sorting columns in a table.
| |||||||||||
Return a list of Lucene SortFields to be used for sorting search results.
| |||||||||||
A sorter to be used when sorting columns in a table.
| |||||||||||
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 untranslated description, for admin. | |||||||||||
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 can be edited, 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.
| |||||||||||
Defines if a field determines itself as renderable.
| |||||||||||
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.
| |||||||||||
Used to populate the fieldValueHolder with parameters for move issue screen.
| |||||||||||
Used for email notification templates - allows changelog to be displayed in language of the recipient.
| |||||||||||
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
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Determines whether the field is available for bulk editing given the BulkEditBean.
bulkEditBean | holds the state of the bulk-edit wizard (e.g. the selected issues for bulk editing) |
---|
null
if the field is available for bulk-editing or an i18n key of the error message to show as
why the field is not available.
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.
If either of given issues is null a IllegalArgumentException is thrown.
issue1 | issue to compare |
---|---|
issue2 | issue to compare |
IllegalArgumentException |
---|
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 |
displayParameters | 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.
The searcher, if found is initialized with this custom field before it is returned.
Looks up the CustomFieldType
. It can return null if the custom
field type cannot be found in the CustomFieldManager
.
Get the custom field string values that are relevant to this particular custom field
customFieldValuesHolder | containing all params |
---|
CustomFieldParams
of String
objects
The order in which to sort the field when it is sorted for the first time.
ORDER_ASCENDING
or ORDER_DESCENDING
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 1i8n'ed description of this custom field. To render views for the custom field description, prefer
getDescriptionProperty()
.
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 |
displayParameters | 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
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.
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.
As this is just used by the view layer, it can be a list of objects
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.
As this is just used by the view layer, it can be a list of objects
key | not used |
---|---|
jiraContextNode | JIRA context node |
MultipleCustomFieldType
type, null otherwise
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 |
---|
The FieldConfig
that is relevent to all issue contexts in the search context
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 |
---|
A sortComparatorSource object to be used for sorting columns in a table. In most cases this will use a
MappedSortComparator
using the getSorter()
method. However, fields can provide any sorting mechanism that they wish.
If a field can be sorted directly using terms in the Lucene index then the field should implement getSortFields(boolean)
rather than this method.
In large installations custom sorting may incur a maor performance penalty.
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()
.
A sorter to be used when sorting columns in a table. This sort uses the Lucene Document Collection and is therefore a lot faster than sorting the issues in memory.
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 untranslated description, for admin.
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)
.
This is only used to communicate with the 'view' JSP. Multiselects will return a list, dates a date, etc.
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.
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 can be edited, 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.Defines if a field determines itself as renderable. This is needed because of the way that customfields are implemented. Since all the real work is done in CustomFieldTypes, if we want to treat system fields and custom fields the same way in the renderers then all custom fields must implement this interface. We therefore provide this method so that the CustomFieldImpl can delegate to the CustomFieldTypes to determine if a given custom field is renderable.
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 |
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 |
FieldValidationException |
---|
Used for email notification templates - allows changelog to be displayed in language of the recipient.
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.
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 |