Interface FieldConfigSchemeManager
- All Known Implementing Classes:
FieldConfigSchemeManagerImpl
public interface FieldConfigSchemeManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionThis magic value list contains a single null element. -
Method Summary
Modifier and TypeMethodDescriptionaddAssociatedContexts
(FieldConfigScheme scheme, Set<JiraContextNode> contextsToBeAdded, ConfigurableField field) Adds new contexts to a config schemecreateDefaultScheme
(ConfigurableField field, List<JiraContextNode> contexts) createDefaultScheme
(ConfigurableField field, List<JiraContextNode> contexts, List<IssueType> issueTypes) createFieldConfigScheme
(FieldConfigScheme newConfigScheme, List<JiraContextNode> contexts, List<IssueType> issueTypes, ConfigurableField field) Returns a non-null list of Projects associated with the given field.getConfigSchemeForFieldConfig
(FieldConfig fieldConfig) Retrieves theFieldConfigScheme
associated with theFieldConfig
getFieldConfigScheme
(Long configSchemeId) Returns a collection ofFieldConfigScheme
s for all Configuration Contexts that will become invalid after the issuetype has been removed.getRelevantConfig
(IssueContext issueContext, ConfigurableField field) Returns the relevant field config of this custom field for the give issue contextgetRelevantConfigScheme
(IssueContext issueContext, ConfigurableField field) Deprecated.getRelevantConfigScheme
(Project project, ConfigurableField field) Returns the FieldConfigScheme for the given Project and ConfigurableField.void
init()
boolean
isRelevantForIssueContext
(IssueContext issueContext, ConfigurableField field) Returns true if the custom field has a config for the Project and Issue Type of the given IssueContext.removeAssociatedContexts
(FieldConfigScheme scheme, Set<JiraContextNode> contextsToBeRemoved, ConfigurableField field) Removes contexts from a config schemevoid
removeFieldConfigScheme
(Long fieldConfigSchemeId) Removes a field config scheme, as well as its associated contexts and field configs (which includes option sets and generic configs)void
removeInvalidFieldConfigSchemesForCustomField
(String customFieldId) Given a CustomField, this method will correctly remove the fieldConfigSchemes if necessary.void
Given an issueType, this method will correctly remove the fieldConfigSchemes if necessary.void
removeSchemeAssociation
(List<JiraContextNode> contexts, ConfigurableField configurableField) Only update the name & description of a fieldupdateFieldConfigScheme
(FieldConfigScheme scheme, List<JiraContextNode> contexts, ConfigurableField field) Updates the config schemes with the new contexts
-
Field Details
-
ALL_ISSUE_TYPES
This magic value list contains a single null element. Do not change to an empty list.
-
-
Method Details
-
init
void init() -
getConfigSchemesForField
-
getConfigSchemeForFieldConfig
Retrieves theFieldConfigScheme
associated with theFieldConfig
- Parameters:
fieldConfig
- the field config to retrieve theFieldConfigScheme
of; cannot be null.- Returns:
- the config scheme for the
FieldConfig
. Null if the config scheme can not be found.
-
getFieldConfigScheme
-
createDefaultScheme
FieldConfigScheme createDefaultScheme(ConfigurableField field, List<JiraContextNode> contexts, List<IssueType> issueTypes) -
updateFieldConfigScheme
FieldConfigScheme updateFieldConfigScheme(FieldConfigScheme scheme, List<JiraContextNode> contexts, ConfigurableField field) Updates the config schemes with the new contexts- Parameters:
scheme
-contexts
-field
-- Returns:
- The updated scheme
-
addAssociatedContexts
FieldConfigScheme addAssociatedContexts(FieldConfigScheme scheme, Set<JiraContextNode> contextsToBeAdded, ConfigurableField field) Adds new contexts to a config scheme- Parameters:
scheme
-contextsToBeAdded
-field
-- Returns:
- The updated scheme
-
removeAssociatedContexts
FieldConfigScheme removeAssociatedContexts(FieldConfigScheme scheme, Set<JiraContextNode> contextsToBeRemoved, ConfigurableField field) Removes contexts from a config scheme- Parameters:
scheme
-contextsToBeRemoved
-field
-- Returns:
- The updated scheme
-
updateFieldConfigScheme
Only update the name & description of a field- Parameters:
scheme
- scheme with the name & description to be updated- Returns:
- the updated scheme
-
removeFieldConfigScheme
Removes a field config scheme, as well as its associated contexts and field configs (which includes option sets and generic configs)- Parameters:
fieldConfigSchemeId
- the id of the field config scheme to remove
-
isRelevantForIssueContext
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, field) != null
but in general can run faster because it does not have to resolve the actual FieldConfig.- Parameters:
issueContext
- IssueContext whose project and issue type will be used to check if the field has a config- Returns:
- true if the custom field has a config for the Project and Issue Type of the given IssueContext.
- See Also:
-
getRelevantConfig
Returns the relevant field config of this custom field for the give issue context- Parameters:
issueContext
- issue context to find the relevant field config for- Returns:
- the relevant field config of this custom field for the give issue context
- See Also:
-
createFieldConfigScheme
FieldConfigScheme createFieldConfigScheme(FieldConfigScheme newConfigScheme, List<JiraContextNode> contexts, List<IssueType> issueTypes, ConfigurableField field) -
createDefaultScheme
-
removeSchemeAssociation
-
getAssociatedProjectObjects
Returns a non-null list of Projects associated with the given field.- Parameters:
field
- the Field- Returns:
- a non-null list of Projects associated with the given field.
-
getRelevantConfigScheme
@Nullable FieldConfigScheme getRelevantConfigScheme(IssueContext issueContext, ConfigurableField field) Deprecated.UsegetRelevantConfigScheme(Project, ConfigurableField)
instead. Since v6.3.7.Returns the FieldConfigScheme for the given Project and ConfigurableField.- Parameters:
issueContext
- actually we ignore the Issue Type and just use the Project.field
- the ConfigurableField- Returns:
- the FieldConfigScheme for the given Project and ConfigurableField.
-
getRelevantConfigScheme
Returns the FieldConfigScheme for the given Project and ConfigurableField.- Parameters:
project
- the Project.field
- the ConfigurableField- Returns:
- the FieldConfigScheme for the given Project and ConfigurableField.
-
getInvalidFieldConfigSchemesForIssueTypeRemoval
Returns a collection ofFieldConfigScheme
s for all Configuration Contexts that will become invalid after the issuetype has been removed. That is the configuration contexts that will no longer be linked to ANY issue types after the issue type passed is has been deleted.- Parameters:
issueType
- The issueType to be deleted- Returns:
- A collection of
FieldConfigScheme
s - Since:
- v3.11
-
removeInvalidFieldConfigSchemesForIssueType
Given an issueType, this method will correctly remove the fieldConfigSchemes if necessary. In other words if a FieldConfigScheme is linked to only a single issueType, and we're deleting that issuetype then that FieldConfigScheme will be deleted. If a FieldConfigScheme is associated with multiple issueTypes, then only the association for the issueType we're deleting will be removed, but the FieldConfigScheme will remain.- Parameters:
issueType
- The IssueType being deleted- Since:
- v3.11
-
removeInvalidFieldConfigSchemesForCustomField
Given a CustomField, this method will correctly remove the fieldConfigSchemes if necessary. In other words if a FieldConfigScheme is linked to only a single CustomField, and we're deleting that field then that FieldConfigScheme will be deleted. If a FieldConfigScheme is associated with multiple fields, then only the association for the field we're deleting will be removed, but the FieldConfigScheme will remain.- Parameters:
customFieldId
- The id of the CustomField being deleted- Since:
- v3.13
-
getRelevantConfigScheme(Project, ConfigurableField)
instead.