Hello armygrad
Is this a json or groovy question? Your first line defining the 'check' variable starts the whole thing off on a bad foot... Unless you are meaning to do some tricky groovyish stuff, i apologize...
I don't know what groovy does when you mix data types... line one you are setting a boolean type to a string type... If you purposely add the boolean type why set to string value?
You might get more consistent results with exacting code:
.
.
.
check = false;
if (response.contains("1234") ) {
check = true;
};
log.info "check=$check";
.
.
.
Regards,
Todd