com.atlassian.jira.issue.CustomFieldManager |
Known Indirect Subclasses |
Clients of @PublicApi
can expect
that programs compiled against a given version will remain binary compatible with later versions of the
@PublicApi
as per each product's API policy as long as the client does not implement/extend
@PublicApi
interfaces or classes (refer to each product's API policy for the exact
guarantee---usually binary compatibility is guaranteed at least across minor versions).
@PublicApi
interfaces and classes are not designed to be implemented or extended by clients,
we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not
affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces
annotated with @PublicSpi
are safe to extend/implement).
Functions for working with CustomField
s.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
clear the cache
| |||||||||||
Creates a custom field with the given name and description of the given CustomFieldType
using the given CustomFieldSearcher that is displayed in the given list of contexts available to the given list of issueTypes.
| |||||||||||
Returns true if this customfield actually exists.
| |||||||||||
Converts a customfield GenericValue to a
CustomField instance. | |||||||||||
Get a CustomField by its text key (eg 'customfield_10000').
| |||||||||||
Get a CustomField by ID.
| |||||||||||
Retrieve the first custom field object with the specified name.
| |||||||||||
Returns a list of
CustomField s that apply to a particular issue. | |||||||||||
Returns the same as
getCustomFieldObjects(Long, String) but allows to specify a list of issueTypes. | |||||||||||
Returns a list of
CustomField s that apply to a particular issue. | |||||||||||
Gets a list of custom fields for a particular project and issue type.
| |||||||||||
Returns all customfields in a particular
SearchContext . | |||||||||||
Returns all custom fields.
| |||||||||||
Retrieve custom field(s) of a certain name.
| |||||||||||
Retrieve a custom field searcher by its type key.
| |||||||||||
Retrieve a custom field searcher by its type key.
| |||||||||||
Retrieves all the searchers registered for a particular custom Field.
| |||||||||||
Retrieve a custom field type by its type key.
| |||||||||||
Retrieve all customfieldtypes registered in the system.
| |||||||||||
Return the default
CustomFieldSearcher for the passed CustomFieldType . | |||||||||||
Returns a list of custom fields where the
isGlobal()
is true. | |||||||||||
Returns true if this ID is in the Custom Field format.
| |||||||||||
reloads all customfields into the cache from the DB, this is an expensive operation, so avoid it if you can.
| |||||||||||
Causes a reload of the field configuration scheme for a specified custom field id
Call when the configuration scheme changes
| |||||||||||
Removes the customfield supplied including all associations and values.
| |||||||||||
Removes the customfield supplied.
| |||||||||||
Removes the values stored by customfields for a particular Issue.
| |||||||||||
Used if a project is deleted to remove the project field associations.
| |||||||||||
Updates the given custom field.
|
clear the cache
Creates a custom field with the given name and description of the given CustomFieldType using the given CustomFieldSearcher that is displayed in the given list of contexts available to the given list of issueTypes.
GenericEntityException | if the CustomField could not be created. |
---|
Returns true if this customfield actually exists. This saves unnecessary copying of custom field objects when all we want to know is "does it exist"
id | Eg. 'customfield_10000' |
---|
Converts a customfield GenericValue to a CustomField
instance.
CustomField
instance
Get a CustomField by its text key (eg 'customfield_10000').
id | Eg. 'customfield_10000' |
---|
CustomField
or null if not found.
Retrieve the first custom field object with the specified name.
WARNING: Custom Field names are no longer guaranteed to be unique.
This method returns the first named custom field. Use getCustomFieldObjectsByName(String)
to retrieve all custom fields.
customFieldName | the Name |
---|
CustomField
, or null if not found.
Returns a list of CustomField
s that apply to a particular issue.
issue | A Issue object |
---|
CustomField
s
Returns the same as getCustomFieldObjects(Long, String)
but allows to specify a list of issueTypes.
projectId | Id of the project. It can be null, in which case means that we are looking for "any project" (acts like a wildcard). |
---|---|
issueTypes | A list of issue types. It can be null or empty, in which case means that we are looking for "any issue type" (acts like a wildcard).
See ALL_ISSUE_TYPES , ALL_STANDARD_ISSUE_TYPES
and ALL_SUB_TASK_ISSUE_TYPES |
CustomField
sReturns a list of CustomField
s that apply to a particular issue.
issue | A GenericValue of the issue |
---|
CustomField
s
Gets a list of custom fields for a particular project and issue type.
projectId | Id of the project |
---|---|
issueType | An issue type. See ALL_ISSUE_TYPES ,
ALL_STANDARD_ISSUE_TYPES and ALL_SUB_TASK_ISSUE_TYPES |
CustomField
s
Returns all customfields in a particular SearchContext
. Also
see isInScope(com.atlassian.jira.issue.search.SearchContext)
.
searchContext | the SearchContext |
---|
CustomField
s
Returns all custom fields.
CustomField
s.
Retrieve custom field(s) of a certain name.
customFieldName | custom field name |
---|
CustomField
s.
Retrieve a custom field searcher by its type key.
The key is the "full plugin module key". That is, the plugin key for the plugin it comes from, a colon separator, and then the module key. e.g. the system types are specified in system-customfieldtypes-plugin.xml:
<atlassian-plugin key="com.atlassian.jira.plugin.system.customfieldtypes" name="Custom Field Types & Searchers"> ... <customfield-type key="float" name="Number Field" ...To access the 'Number Field' type, the key would then be 'com.atlassian.jira.plugin.system.customfieldtypes:float'.
key | Type identifier constructed from plugin XML. |
---|
Retrieve a custom field searcher by its type key.
The key is the "full plugin module key". That is, the plugin key for the plugin it comes from, a colon separator, and then the module key. e.g. the system types are specified in system-customfieldtypes-plugin.xml:
<atlassian-plugin key="com.atlassian.jira.plugin.system.customfieldtypes" name="Custom Field Types & Searchers"> ... <customfield-type key="float" name="Number Field" ...To access the 'Number Field' type, the key would then be 'com.atlassian.jira.plugin.system.customfieldtypes:float'.
key | Type identifier constructed from plugin XML. |
---|
Retrieves all the searchers registered for a particular custom Field. Searchers may be registred via:
<customfield-searcher key="daterange" name="Date Range picker" i18n-name-key="admin.customfield.searcher.daterange.name" class="com.atlassian.jira.issue.customfields.searchers.DateRangeSearcher">
customFieldType | the CustomFieldType |
---|
CustomFieldSearcher
s
Retrieve a custom field type by its type key.
The key is the "full plugin module key". That is, the plugin key for the plugin it comes from, a colon separator, and then the module key. e.g. the system types are specified in system-customfieldtypes-plugin.xml:
<atlassian-plugin key="com.atlassian.jira.plugin.system.customfieldtypes" name="Custom Field Types & Searchers"> ... <customfield-type key="float" name="Number Field" ...To access the 'Number Field' type, the key would then be 'com.atlassian.jira.plugin.system.customfieldtypes:float'.
key | Type identifier constructed from plugin XML. |
---|
Retrieve all customfieldtypes registered in the system.
CustomFieldType
s
Return the default CustomFieldSearcher
for the passed CustomFieldType
. The default searcher can
be null if there is no searcher associated with the type.
type | the CustomFieldType to query. |
---|
CustomFieldType
. Can be null if the type has no associated
searcher.
Returns a list of custom fields where the isGlobal()
is true.
CustomField
s
Returns true if this ID is in the Custom Field format.
Note that this does not check if the Custom Field actually exists. It just checks whether the given ID looks like Custom Field ID (eg starts with "customfield_").
id | The Field ID |
---|
reloads all customfields into the cache from the DB, this is an expensive operation, so avoid it if you can.
Causes a reload of the field configuration scheme for a specified custom field id Call when the configuration scheme changes
customFieldId | the custom field ID |
---|
Removes the customfield supplied including all associations and values.
customField | The CustomField to be removed. |
---|
RemoveException | On any error removing the custom field |
---|
Removes the customfield supplied. This method will try to lookup the customfield object via the manager first.
If the customfield object can be retrieved this way, it simply delegates the removal to the
removeCustomField(com.atlassian.jira.issue.fields.CustomField)
method, which will not leave any orphaned
data behind.
NOTE: Generally you should use the removeCustomField(com.atlassian.jira.issue.fields.CustomField)
method to remove a custom field, as it is guaranteed to remove all data. This method should only be used if
a customfield needs to be removed when the customfieldtype for that field is no longer available!
If however the customfield object cannot be retrieved via the manager, which may be the case if the custom field
type is no longer available (a plugin may have been removed), then this method will try to lookup the custom
field directly in the database. If it doesn't exist in the database, an IllegalArgumentException will
be thrown. Otherwise, the customfield and all associated configurations will be removed. This method
will also call to the removeAllValues(String)
method to delete any values. Please note however, that if your custom field stores any other values (such
as options for example), they will have to be removed by the caller of this method, as the custom field type
is not accessible (which is usually responsible for removing such values).
customFieldId | The id of the customField to be removed. |
---|
RemoveException | On any error removing the custom field |
---|---|
IllegalArgumentException | If no customfield matching the customFieldId can be found |
Removes the values stored by customfields for a particular Issue.
issue | The issue GenericValue |
---|
GenericEntityException | DB error |
---|
Used if a project is deleted to remove the project field associations.
project | The project being deleted. |
---|
Updates the given custom field.
id | the custom field ID |
---|---|
name | the new name |
description | the new description |
searcher | the new Searcher |