The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Locked or Managed Jira fields

jira_admin_cu
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 Champions.
April 18, 2023

Hi Team,

We have field name called "Treatment:, it came up with addon "Risk Register". By mistake I unlock this field to check something using script mentioned in this scrip runner document. 

https://confluence.atlassian.com/jirakb/unlock-a-locked-jira-custom-field-using-scriptrunner-1167828785.html

When I ran the second script to unlock, the field "Treatment" is moved from "Managed" tag to "Locked". With "Managed" tag, I can configure the field, but not with "Locked". Is there any possibility to put it back from "Locked" to "Managed" ?

Please find the attached screenshots for your reference.

Before change :

 

treat1.PNG

After Change :

 

Treatment1.PNGTreatment2.PNG 

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Brian Jopspeh
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2026

You may need to re-lock the field first and then check whether Jira restores its managed status, rather than trying to edit the field directly. I’d check the Risk Register documentation on the Atlassian website as well, since the addon may control that field’s state.

0 votes
jira_admin_cu
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 Champions.
April 26, 2023

Solution : It worked.

If we run the second script again but change ConfigurationItemAccessLevel.LOCKED to ConfigurationItemAccessLevel.ADMIN this should return the field to 'managed' and allow edits to be made.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.managedconfiguration.ConfigurationItemAccessLevel
import com.atlassian.jira.config.managedconfiguration.ManagedConfigurationItemService
import com.atlassian.jira.issue.CustomFieldManager
ManagedConfigurationItemService managedConfigurationItemService = ComponentAccessor.getComponent(ManagedConfigurationItemService)
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()

def cf = customFieldManager.getCustomFieldObjectByName('Treatment')

if (cf) {
def mci = managedConfigurationItemService.getManagedCustomField(cf)
if (mci)

{ def managedConfigurationItemBuilder = mci.newBuilder(); def updatedMci = managedConfigurationItemBuilder .setManaged(true) .setConfigurationItemAccessLevel(ConfigurationItemAccessLevel.ADMIN) .build(); managedConfigurationItemService.updateManagedConfigurationItem(updatedMci); }
}
0 votes
PD Sheehan
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 Champions.
April 18, 2023

I would suggest you query all the details of either another locked field from that addon or the same field in a different instance to view all the attributes of the mci.

Then remove the fields from the managed configuration and add it back with the missing property.

For example, the only managed items I have are related to agile. The code on that kbase for adding the item back is missing a step to set the source and i18n description

 

.setSource('com.pyxis.greenhopper.jira:reference-select-locked')
.setDescriptionI18nKey('gh.customfield.locked.desc')

There should be something similar for your field.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.