How to get a custom field type using groovy?

Adam Howerts December 19, 2017

Hello,
I want to run a script which identifies the type of custom field and generates a report. Is this achievable using script runner?

I'm looking for a way to get the type of every custom field.

Thanks a mil.

1 answer

1 vote
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 19, 2017

Hello,

 

This code would iterate over all custom fields and log all of them with their types

import com.atlassian.jira.component.ComponentAccessor
def customFields = ComponentAccessor.getCustomFieldManager().getCustomFieldObjects()

customFields.each{log.error(it.getFieldName() + " " + it.getCustomFieldType().getName())}

Suggest an answer

Log in or Sign up to answer