Hello!
I'm trying to use ScriptRunner Behaviours to make a field read-only once it's filled out. I can get this to work for certain field types (i.e., single-select) but not for numeric field types. Any ideas how to access the "value" for a numeric field type or is it not possible? TYIA!
Script
var storyPoint = getFieldById("customfield_XXXXX")
var storyPointValue = storyPoint.getValue()
if(storyPointValue != null){
storyPoint.setReadOnly(true);
}
else {
storyPoint.setReadOnly(false);}Single-Select Field Example
- This works fine because there's a value object to return.
"customfield_10255": {
"self": "https://< >.atlassian.net/rest/api/2/customFieldOption/10424",
"value": "Yes",
"id": "10424"
},Numeric Field Example
- How do I return the "value" (i.e., 5) in my script so it'll work?
"customfield_10025": 5,