I have a custom field of multiple check boxes , in which i want that one field should remain always select and user will not be able to deselect it. I have below code in groovy code for checking the null values:
CustomField SOPlist = customFieldManager.getCustomFieldObject("customfield_13087"); def sop = (String[]) issue.getCustomFieldValue(SOPlist); if(sop ==null ){ invalidInputException = new com.opensymphony.workflow.InvalidInputException(" field is mandatory"); }
For that particular option i have tried using below code:
CustomField mandate = customFieldManager.getCustomFieldObject("customfield_13087-1"); String madPlugin = (String) issue.getCustomFieldValue(mandate);
But the above is not working throwing the below error:
The script failed : javax.script.ScriptException: javax.script.ScriptException: java.lang.NumberFormatException: For input string: "13087-1"
Please help.
Thanks in advance
Community moderators have prevented the ability to post new answers.
Hello Nikhil,
the CustomFieldManager's method called "getCustomFieldObject" excepts a String to be of format
customfield_<customfield_id>
If you try to access the ID "customfield_13087-1" the expected number format won't match the given value.
You should try "getCustomFieldObjects" or "getCustomFieldObjectByName" for your purposes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.