Hi all,
Our Jira admin team is trying to save time by using the scriptrunner console to pull all customfields and their details within our instance at the same time.
Our main goal is to reteive the following for each customfield being pulled within the report:
1) Name
2) ID
3) Type
4) Value (if applicable - text fields don't have a 'value')
5) Issue Type the customfield is associated with
So far we have the script below, but it's not working. Can anyone point us in the correct direction?
import com.atlassian.jira.component.ComponentAccessor
import groovy.xml.MarkupBuilder
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def stringWriter = new StringWriter()
def content = new MarkupBuilder(stringWriter)
customFieldManager.customFieldObjects.each { customField ->
def customFieldName = customField.name
def customFieldId = customField.id
def customFieldType = customField.getCustomFieldType().name
def associatedIssueTypes = customField.getAssociatedIssueTypes().collect { it.name }
content.html {
p {
"${customFieldName};${customFieldId};${customFieldType};${associatedIssueTypes}"
}
}
}
stringWriter.toString()