title: How can one convert an environment variable to a string in groovy
body: <p>In a jenkins file pipeline I have:</p>
  
  <pre><code>def task = readJSON(file: 'ecs/task-definition.json')
  echo "Read Task Definition: $task"
  task.containerDefinitions[0].image="${AWS_VERSION_IMAGE}"
  echo "New Task Definition With Image Is: $task"
  </code></pre>
  
  <p>In the output value of the second echo statement i get:</p>
  
  <pre><code>New Task Definition With Image Is: [name:proxy, image:[bytes:[48, 48, 55, 49, 50, 54, 53, 56, 51, 55, 53, 55, 46, 100, 107, 114, 46]]
  </code></pre>
  
  <p>where <code>AWS_VERSION_IMAGE</code> is an environment variable defined as <code>AWS_VERSION_IMAGE = "${AWS_DOCKER_REGISTRY}:${VERSION_TAG}"</code> in an <code>environment</code> block.</p>