I am looking for a way to list / iterate through all the 'Field Configurations' which are displayed on the screen: https://jira.***.com/secure/admin/ViewFieldLayouts.jspa
This needs to be regardless of Project or 'Field Configuration Scheme'
Once i can do that, then the intention is to go through each and make adjustments as required.
As far as I know, you can't directly get all field configurations without a project or field config layout. To list or iterate through all field configurations, you'd typically need to go through the schemes and then get the configurations associated with them.
You can navigate through the projects, field configuration schemes, and field configurations. Here’s an approach which might help:
Here is a code you can start with:
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.project.ProjectManagerimport com.atlassian.jira.issue.fields.layout.field.FieldLayoutManagerimport com.atlassian.jira.issue.fields.layout.field.FieldLayoutProjectManager projectManager = ComponentAccessor.getProjectManager()FieldLayoutManager fieldLayoutManager = ComponentAccessor.getFieldLayoutManager()// List to hold all unique field configurationsSet<FieldLayout> allFieldConfigs = new HashSet<>()// provide issue type ids to retrieve field configurations for Collection<String> allIssueTypeIds = ... // // Iterate through all projectsprojectManager.getProjectObjects().each { project -> // Get the Field Configuration Scheme for the project def fieldConfigScheme = fieldLayoutManager.getFieldConfigurationScheme(project) fieldConfigScheme.getAllFieldLayoutIds(allIssueTypeIds).each { fieldLayoutId -> // Get the FieldLayout (Field Configuration) FieldLayout fieldLayout = fieldLayoutManager.getFieldLayout(fieldLayoutId) allFieldConfigs.add(fieldLayout) }}// Now you have all field configurations allFieldConfigs.each { fieldLayout -> log.info "Field Configuration Name: ${fieldLayout.name}" }
I hope it helps.
You should be able to use the getEditableFieldLayouts() method to get all your layouts.
import com.atlassian.jira.component.ComponentAccessorComponentAccessor.fieldLayoutManager.editableFieldLayouts.collect{"$it.id: $it.name"}.join('<br>')
It looks like you're new here. Sign in or register to get started.