Hi,
I am trying to enable some fields when Roadmap Item = Tactical [single select type] else the fields will be disabled. Can someone help me and i tried below code doesn't seem working.
def dropDown = getFieldById("customfield_15200")
if (dropDown.getValue() == "Tactical") {
def ccgroup = getFieldByName("Name")
def ccgroup1 = getFieldByName("Solution")
def ccgroup2 = getFieldByName("Theme/s") //Group
def ccgroup3 = getFieldByName("Driver Category")
ccgroup.setReadOnly(false)
ccgroup1.setReadOnly(false)
ccgroup2.setReadOnly(false)
ccgroup3.setReadOnly(false)
}Thanks
Teju Naik
Your issue might be just with the "def myCustomField" line.
If you look carefully, you will see that you are calling "getCustomFieldObjectsByName", the plural on "Objects" means that you can potentially get more than one custom field with this method. Even when you only have 1 custom field that matches that name, you will still get a collection or array of custom fields and you have to identify which item in the collection is the custom field you care about.
If you are 100% sure that you only have 1 custom field with that name, you can just get item 0 from the collection.
def myCustomField = customFieldManager.getCustomFieldObjectsByName("Custom multi-user field")[0]
Peter-Dave...is it possible to be so happy and so mad at the same time? Because those 3 characters "[0]" just made me into a WINNER! Next time you are in KC I owe you a beverage. Thank you sir. Consider your answer...ACCEPTED!
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.