Class CustomFieldBulkDeleteManager
java.lang.Object
com.atlassian.jira.issue.managers.CustomFieldBulkDeleteManager
Validates the DELETE request sent to @CustomFieldResource for custom fields' single and bulk deletion.
Checks if the custom fields can be deleted and either deletes them or provides information why they cannot be deleted.
since 8.16
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCustomFieldBulkDeleteManager
(CustomFieldManager customFieldManager, CustomFieldService customFieldService, ClusterManager clusterManager, FeatureManager featureManager, ManagedConfigurationItemService managedConfigurationItemService, com.atlassian.beehive.ClusterLockService clusterLockService, FieldScreenManager fieldScreenManager, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Feature is available since 8.16 for DC instances and can be turned off with jira.customfields.bulk.delete flag.void
validateAndDeleteCustomFields
(JiraAuthenticationContext jiraAuthenticationContext, List<String> customFieldsIds, Long bulkOperationStartTime) For each custom field in the list validates if the custom field can be deleted.boolean
validateNumberOfArguments
(List<String> customFields) We allow a maximum of 50 custom fields in delete request as this is the number of custom fields per page on custom field view.
-
Field Details
-
MAX_NUMBER_OF_CUSTOM_FIELDS_TO_DELETE
public static final int MAX_NUMBER_OF_CUSTOM_FIELDS_TO_DELETE- See Also:
-
BULK_DELETE_FEATURE_FLAG
-
BULK_DELETE_LOCK_NAME
-
LOCK_NOT_ACQUIRED_MESSAGE
- See Also:
-
VALIDATION_FOR_CUSTOM_FIELD_DELETION_FAILED_MESSAGE
- See Also:
-
-
Constructor Details
-
CustomFieldBulkDeleteManager
public CustomFieldBulkDeleteManager(CustomFieldManager customFieldManager, CustomFieldService customFieldService, ClusterManager clusterManager, FeatureManager featureManager, ManagedConfigurationItemService managedConfigurationItemService, com.atlassian.beehive.ClusterLockService clusterLockService, FieldScreenManager fieldScreenManager, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
isDCAndFeatureFlagOn
public boolean isDCAndFeatureFlagOn()Feature is available since 8.16 for DC instances and can be turned off with jira.customfields.bulk.delete flag.- Returns:
- true if instance is DC and feature flag is on, false otherwise
-
validateNumberOfArguments
We allow a maximum of 50 custom fields in delete request as this is the number of custom fields per page on custom field view.- Parameters:
customFields
- list of custom fields selected for deletion- Returns:
- true if customFields is a list with at least 1 and no more than 50 values, false otherwise
-
validateAndDeleteCustomFields
public Map<String,String> validateAndDeleteCustomFields(JiraAuthenticationContext jiraAuthenticationContext, List<String> customFieldsIds, Long bulkOperationStartTime) For each custom field in the list validates if the custom field can be deleted. If the validation passes the custom field is deleted. If the validation fails we provide the information about why the custom field cannot be deleted.- Parameters:
jiraAuthenticationContext
- contextcustomFieldsIds
- ids of custom fields to be deletedbulkOperationStartTime
- timestamp of when the bulk delete request was sent (for analytics events' purpose)- Returns:
- a map of custom fields that were not deleted, where the key is custom field's id and the value the reason for failed validation
-
onLicenseChanged
-