Hello everyone,
I noticed that a Groovy script is causing errors.
Until now, I have been using issue.get(‘customfield_11802’)?.get(null)?.optionId == 15017.
No signature of method: java.lang.String.get() is applicable for argument types: (null) values: [null] Possible solutions: grep(), next(), grep(java.lang.Object), getAt(groovy.lang.EmptyRange), getAt(int), getAt(groovy.lang.Range)
I have currently changed it to issue.get(‘customfield_11802’) != ”Yes, checked“.
I found various methods (getGlobalItemId, option.getOptionId()) on the Internet, but none of them produced the desired result for me.
Do you have a solution for me on how I can read the selected OptionID?
Best Regards
Ralf
I guess this is happening, as the issue.get returns a plain java.lang.String (the text value of the option) instead of an Option object. Have you tried the method getRawValue(), which returns the actual Option object for select fields?
If you prefer to bypass the simplified JMWE wrapper and query Jira's native internal custom field value, you could use something like issue.getCustomFieldValue('customfield_11802')?.optionId == 15017.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.