Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Parse step output into variable #4067

scastrianni ·

I need to run a Shell/Batch command step and grab the JSON output from that command and parse it to set a variable to be used in the next step. After all of these years, I am surprised I have never needed to do this. Is it possible? I would prefer not to redirect the output to a file and then read the file if possible. I was hoping for something more elegant.

  • replies 1
  • views 11
  • stars 0
robinshen ADMIN ·

You may run the command with a groovy script to get the output easily:

groovy:
def command = "some command"
def json = command.execute().text