Hi Community,
Scriptrunner Jira Datacenter: how to hide the option in checkbox custom field
Thanks.
Hi @Saqib Dar ,
you can implement that through a behaviour (https://docs.adaptavist.com/sr4js/latest/features/behaviours).
A simple code could be the following :
def singleSelect = getFieldByName("YOUR_CUSTOM_FIELD_NAME_HERE")
def optionsManager = ComponentAccessor.getOptionsManager()
def cf = getFieldByName("FieldName")
def cfField = customFieldManager.getCustomFieldObject(cf.getFieldId())
def cfConfig = cfField.getRelevantConfig(getIssueContext())
def cfOptions = optionsManager.getOptions(cfConfig)
def cfA = cfOptions.findAll { it.value in ["A","B","C","D"] }.collectEntries { [ (it.optionId.toString()) : it.value ] }
cf.setFieldOptions(cfA)
Hope this helps,
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.