Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Groovy Scripting (JMWE) - OptionID

Ralf Fehling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
February 9, 2026

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

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Martin Runge
Community Champion
June 8, 2026

Hi @Ralf Fehling

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.

DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events