related to:
https://answers.atlassian.com/questions/51896
https://answers.atlassian.com/questions/9868061
https://answers.atlassian.com/questions/13416427
i want to delete hundreds of custom fields. is it possible to do this without clicking through the UI for each custom field?
Community moderators have prevented the ability to post new answers.
Hi Dmitri,
If you write your own plugin or use Script runner, below code can simply delete custom fields.
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); Collection<CustomField> customFields = customFieldManager.getCustomFieldObjects(); for (CustomField field: customFields) { if (checkFieldToBeDeleted(field)) { customFieldManager.removeCustomField(field); } }
As far as I know there is no REST support yet to do that, but there is a quite old open issue regarding that.
Hope it helps,
Tuncay
Before deleting custom fields you can review their values using Custom Fields Usage plugin
https://marketplace.atlassian.com/plugins/systems.npe.jira.cfu/server/overview
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can anyone from Adaptavist elaborate on how to delete a bunch of custom fields quickly with ScriptRunner for JIRA? For example, I'd like to delete all the fields starting "abc".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rıchard,
Actually you can do that with the script above (I provided).
within checkFieldToBeDleted function all you need to do is return true if custom field's name starts with "abc". Similar as below
def checkFieldToBeDeleted(field) { return field.name.startsWith("abc") }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the removeCustomField action from JIRA Command Line Interface (CLI). You may want to wrap that with one of the run actions like runFromCsv or runFromSql.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.