title: Jenkins: Retrieve a variable from json file and use it after
body: <p>I have a issue on jenkins. I make a http request and this return me a json file like this:</p>
  
  <pre><code>httpRequest authentication: 'b689fe3c-117e-4076-b10d-fe16ab14742f', httpMode: 'POST', outputFile: 'merge.json', responseHandle: 'NONE', url:'http://address:port/prweb/api/v1/branches/TestB/merge'
  
  
  {  "ID": "SYSTEM-QUEUE-MERGE 50304628545400035CA951969013040610A435733ECEAE8",
   "pxObjClass": "Pega-API-CI-Branch",
   "statusValue": "OK"
  }
  </code></pre>
  
  <p>I want the ID to use in a other http request: </p>
  
  <pre><code>http://address:port/prweb/api/v1/merges/{$ID}
  </code></pre>
  
  <p>I try to catch the Id like this: ID=$(cat merge.json |grep -o SY.*[a-z] (all json file are the same)</p>
  
  <p>I try to catch the ID in a sh pipe but he doesn't work, so I tried to define on the step, same as before. If someone had the solution, it'll be great for me!
  I continue to search and I'll edit if I suceed </p>
  
  <p>Edit: the code of my pipe:</p>
  
  <pre><code>pipeline{
  agent any
  stages{
      stage ('Merge Branch') {
  
          steps{
  
              httpRequest authentication: 'b689fe3c-117e-4076-b10d-fe16ab14742f', httpMode: 'POST', outputFile: 'merge.json', responseHandle: 'NONE', url: 'http://address:port/prweb/api/v1/branches/TestB/merge'
  
              httpRequest authentication: 'b689fe3c-117e-4076-b10d-fe16ab14742f', httpMode: 'GET', outputFile: 'merge3.json', responseHandle: 'NONE', url: 'http://address:port/prweb/api/v1/merges/'
  
          }
      }
  }
  </code></pre>
  
  <p>}</p>