Forums

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

How to set specified field behavior to hidden in all screens using Groovy

lpopek August 24, 2018

Hello, 
I have one field set on visible in many screens. I want to change it to hidden using groovy. Can anyone help me with this? 

This is my not working code 

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField customField = customFieldManager.getCustomFieldObject(11111)
def valueOfCustomField = customField.g
Collection<CustomField> allCustomFields = customFieldManager.getCustomFieldObjects()

for(CustomField e : allCustomFields){
log.info(e.getName())
}

1 answer

0 votes
Tarun Sapra
Community Champion
August 24, 2018

Hello @lpopek

Why do you want to change it to hidden? Under what condition?

With SR plugin, we generally use Behaviour module to make fields hidden or shown based on some criteria

https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html

Hidden fields

https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html#_hidden_fields

Suggest an answer

Log in or Sign up to answer