I am mange to delete screen, screen scheme, issue type screen scheme.
Is there any script to bulk delete Unused Field Configuration/Field Configuration Scheme?
Hi,
I think you should use the FieldLayoutManager instead of the FieldConfigSchemeManager from the answer above. If you have a list of ID's you can use
import com.atlassian.jira.component.ComponentAccessor
def fieldLayoutManager = ComponentAccessor.getFieldLayoutManager()
def toDelete = [12345L, 23456L, ...]
toDelete.each {
try {
def scheme = fieldLayoutManager.getMutableFieldLayoutScheme(it)
fieldLayoutManager.removeFieldLayoutScheme(scheme)
} catch (Exception e) {
log.error "Could not delete field config scheme " + it
}
}
Hi @Naman Mandli ~ I hope you are able to delete screen, screen scheme and issue type screen scheme through Atlassian SDK.
Below API methods from Atlassian SDK might help you to delete Field Configuration Scheme/s.
removeFieldConfigScheme(Long fieldConfigSchemeId)
Removes a field config scheme, as well as its associated contexts and field configs (which includes option sets and generic configs)
removeInvalidFieldConfigSchemesForCustomField(String customFieldId)
Given a CustomField, this method will correctly remove the fieldConfigSchemes if necessary.
removeInvalidFieldConfigSchemesForIssueType(IssueType issueType)
Given an issueType, this method will correctly remove the fieldConfigSchemes if necessary.
Please keep posted for any questions.
Thanks,
RamaRao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Naman Mandli ,
If you feel like my answer helped you, kindly mark my answer as accepted.
Thanks,
RamaRao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there any script to delete unused Field Configuration Schemes, Field Configurations and Fields?
Also, Unused Issue Types Schemes and Issue Types.
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.