com.atlassian.jira.issue.fields.FieldManager |
![]() |
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).
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | CUSTOM_FIELD_PREFIX |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return all the searchable fields in the system.
| |||||||||||
Retrieves custom fields in scope for the given issue
| |||||||||||
Gets all the available fields within the defined scope of the QueryContext.
| |||||||||||
Gets all the available fields that the user can see, this is providing no context scope.
| |||||||||||
Get a CustomField by its text key (eg 'customfield_10000').
| |||||||||||
Get a field by its id.
| |||||||||||
Retrieve the IssueType system Field.
| |||||||||||
Retrieve the Project system Field.
| |||||||||||
Return all the searchable systems fields.
| |||||||||||
Returns all the visible FieldLayouts for the given user.
| |||||||||||
This method is deprecated.
Use
isExistingCustomField(String) or isCustomFieldId(String) instead. Since v6.5.
| |||||||||||
Returns true if the given field ID is in the custom field format.
| |||||||||||
Returns true if the given ID is a Custom Field that actually exists in JIRA.
| |||||||||||
Determines whether the field with id of fieldId is NOT hidden in AT LEAST one
FieldLayout that the user can see
(assigned to projects for which the user has the BROWSE_PROJECTS permission). | |||||||||||
Checks whether the given field is hidden in all of the given Field Layouts.
| |||||||||||
Invalidates all field-related caches in JIRA.
|
Return all the searchable fields in the system. This set will included all defined custom fields.
Retrieves custom fields in scope for the given issue
remoteUser | Remote com.atlassian.jira.user.ApplicationUser |
---|---|
issue | Issue |
FieldException | if cannot retrieve the projects the user can see, or if cannot retrieve the field layouts for the viewable projects |
---|
FieldException |
---|
Gets all the available fields within the defined scope of the QueryContext.
user | the user making the request |
---|---|
queryContext | the context of the search request. |
FieldException | thrown if there is a problem looking up the fields |
---|
Gets all the available fields that the user can see, this is providing no context scope.
user | the remote user. |
---|
FieldException | thrown if there is a problem looking up the fields |
---|
Get a CustomField by its text key (eg 'customfield_10000').
id | Eg. 'customfield_10000' |
---|
CustomField
or null if not found.
Get a field by its id.
id | An IssueFieldConstants constant, or custom field key (eg. "customfield_10010") |
---|
Retrieve the IssueType system Field.
Retrieve the Project system Field.
Return all the searchable systems fields. This set will *NOT* include defined custom fields.
Returns all the visible FieldLayouts for the given user.
This is used in conjunction with isFieldHidden(Set, Field)
as a performance optimisation in usages that want to call isFieldHidden(com.atlassian.jira.user.ApplicationUser, Field)
multiple times.
Instead, it is more efficient to do something like:
SetfieldLayouts = fieldManager.getVisibleFieldLayouts(loggedInUser); for (Field field: myFields) { if (fieldManager.isFieldHidden(fieldLayouts1, field)) { ... } }
user | the user whose project browsing permissions are used to limit visible FieldLayouts. |
---|
This method is deprecated.
Use isExistingCustomField(String)
or isCustomFieldId(String)
instead. Since v6.5.
Returns true if the given ID is a Custom Field that actually exists in JIRA.
id | the field ID |
---|
Returns true if the given field ID is in the custom field format.
This method just checks that the ID looks like a Custom Field (it starts with "customfield_") but not that the custom field actually exists (it could have been deleted).
id | the field ID |
---|
Returns true if the given ID is a Custom Field that actually exists in JIRA.
Checking for existance comes with a performance price, so use where possible
.
id | the field ID |
---|
Determines whether the field with id of fieldId is NOT hidden in AT LEAST one FieldLayout
that the user can see
(assigned to projects for which the user has the BROWSE_PROJECTS
permission).
remoteUser | the remote user. |
---|---|
fieldId | The Field ID |
Checks whether the given field is hidden in all of the given Field Layouts.
This method can be used in conjunction with getVisibleFieldLayouts(com.atlassian.jira.user.ApplicationUser)
to provide a more performant way of looking up isFieldHidden(com.atlassian.jira.user.ApplicationUser, Field)
multiple times.
Instead, it is more efficient to do something like:
SetfieldLayouts = fieldManager.getVisibleFieldLayouts(loggedInUser); for (Field field: myFields) { if (fieldManager.isFieldHidden(fieldLayouts1, field)) { ... } }
fieldLayouts | The FieldLayouts to check |
---|---|
field | The field to check |
Invalidates all field-related caches in JIRA.
WARNING
This method invalidates a whole lot of JIRA caches, which means that JIRA performance significantly degrades
after this method has been called. For this reason, you should avoid calling this method at all costs.
The correct approach to invalidate the cache entries is to do it in the "store" inside the FooStore.updateFoo()
method, where you can invalidate a single cache entry. If the cache lives in another class then the store
should raise a FooUpdatedEvent
which that class can listen to in order to keep its caches up to date.
If you add any calls to this method in JIRA I will hunt you down and subject you to a Spanish inquisition.