How do parse this json in jenkins pipeline. I tried several options link org.groovy.StringEscapeUtils , JsonSlurper.
Nothing seems to work , Need help on the same
import groovy.json.JsonException
import groovy.json.JsonSlurper
try {
print new JsonSlurper().parseText('''
{
\"hello\": \"world with quotation marks\"
}
''')
} catch (JsonException | IllegalArgumentException e) {
print e
}
output : [hello:world with quotation marks]
Expected : {"hello" : "world with quotation marks"}