I have 2 if conditions and within them I define custom fields to update the values. However, within the second if block the following line generate a MissingPropertyException error.
CustomField uploadStatus = customFieldManager.getCustomFieldObjectByName("Upload Status");
The error:
The script failed : javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: customFieldManager for class: Script79
If I defined the above line outside of the if-block there are no errors (I can also successfully print the value). What I find odd is I have the same line defined within the first if-block which works fine.
Unsure if this is useful but I've define the following outside of the if conditions:
ComponentManager componentManager = ComponentManager.getInstance(); CustomFieldManager customFieldManager = componentManager.getCustomFieldManager();
Fairly new to this so let me know if further information is required, thanks.
Can you provide the complete code (including the definitions, if blocks, and whatever is between them)? Best perhaps is to create the simplest code that still reproduces the error message.
Thanks. I found the issue to be where the code was sitting. I have fixed it now and the error is not longer present.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.