Hey all,
I have been trying to set a field to read only if another custom field equals a specific value.
What I have: (I'm new to groovy so be nice :P)
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def resultsType = getFieldById("customfield_12051")
def archive = getFieldById("customfield_12155")
if (resultsType.getValue() == 'Direct')
{
archive.setReadOnly(true)
}else{
archive.setReadOnly(false)
}
Got it working with a server side script but it won't work on initialisation. I'm sure I read somewhere that on initialisation custom field values cannot be read?
Thanks