Consider code:
Map prJsonData = readJSON text: '{}'
prJsonData.head = "release/${NEW_TAG}" as String
prJsonData.title = "Release ${NEW_TAG}"
writeJSON(file: 'create-pr.json', json: prJsonData, pretty: 4)
and output
{
"head": "release/v1.0.2",
"title": {
"bytes": [
82,
101,
97
],
"strings": [
"Release ",
""
],
"valueCount": 1,
"values": ["v1.0.2"]
}
}
Why is it that specifying as String changes the output such that interpolation works but without this the output appears to be some sort of complex type.