Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

list all locked custom field

Deleted user March 27, 2018

can we see a list of field names which have been locked, please ?

for example, I see a few of field like this, while a list would be nice in jira or in jira database. 

Sprint LOCKED

JIRA Software sprint field

3 answers

3 votes
Jaron Stevenson
Contributor
November 21, 2019

I know this is an old topic, but it came up on Google when I was trying to figure out this exact thing. I managed to find an answer, so I figured I'd post in case anyone in the future is in my situation.

This SQL query should return a list of all Locked custom fields:

SELECT * FROM managedconfigurationitem
WHERE item_type='CUSTOM_FIELD' AND access_level='LOCKED'

I used it because I needed a list of custom fields that weren't locked when evaluating fields that are no longer in use in our instance (one which I inherited that somehow accumulated over 1,000 custom fields).

Slava Gefen
Contributor
November 22, 2022

This helped, thanks!

0 votes
alfafire March 18, 2025

Hello,

I wrote ScriptRunner script for that purpose (for Jira Server):

import com.atlassian.jira.issue.fields.CustomField

import com.atlassian.jira.config.managedconfiguration.ConfigurationItemAccessLevel

import com.atlassian.jira.config.managedconfiguration.ManagedConfigurationItemService

import com.atlassian.jira.component.ComponentAccessor


def cfm = ComponentAccessor.getCustomFieldManager()

ManagedConfigurationItemService managedConfigurationItemService = ComponentAccessor.getComponent(ManagedConfigurationItemService)


List<CustomField>
cfs = cfm.getCustomFieldObjects()

List<CustomField> lockedCfs = new ArrayList<>()


cfs.each {
CustomField cf ->

    if (cf) {

        def mci = managedConfigurationItemService.getManagedCustomField(cf)

        if (mci && mci.getConfigurationItemAccessLevel() == ConfigurationItemAccessLevel.LOCKED) {

            lockedCfs.add(cf)

        }

    }

}


lockedCfs.each {


    log.info it.name

}

 

0 votes
Nic Brough -Adaptavist-
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.
March 27, 2018

Go to Admin ->  Issues -> Custom fields and read the list, looking for the word "locked".

I'm curious as to why you ask (because it's useless information for anyone other than the current admin checking no-one has messed up the config by hacking the database), and why you didn't already know that was the answer.

Matt Doar
Community Champion
March 27, 2018

I think I found this using the database customfield table once

Matt Doar
Community Champion
March 27, 2018

Oh, or a ScriptRunner script looking at each custom field. Or REST API.

Nic Brough -Adaptavist-
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.
March 27, 2018

I think I scribbled something out for REST once as well.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events