Forums

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

Groovy -- How to know if checkbox is checked?

Gleb Kartashov
Contributor
February 10, 2022

How to check if checkbox is checked without crashing the post function? say issue.get("customfield_13219") is my checkbox field. I need to know if it's checked or not. If I use .size or .value methods while issue doesn't have this checkbox checked script return this error:

Message:
java.lang.NullPointerException: Cannot get property 'value' on null object

If this happens inside a post function this transition will abort. I need to check the value without it crashing. I use JMWE app

1 answer

1 accepted

1 vote
Answer accepted
Gleb Kartashov
Contributor
February 10, 2022

Ok I just realised it I need to simply compare customfield value to null and it works

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events