I have curl respond and need to extract a 337 characters long token. I parsed the JSON respond with the JSONSlurper. But as soon as I assign the JSON value to the Jenkins String variable the variable becomes a null object, any bugs or string length limitation?
Here is my test script
def parser = new groovy.json.JsonSlurper()
def token_respond=parser.parseText(respond)
def token=‘ABCD test’
println token
token=token_respond.I’d
println token
The first println print out “ABCD test’ correctly
The second println get error
“Cannot get property ‘token’ on null object.
Please help