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.
You may run the command with a groovy script to get the output easily:
groovy:
def command = "some command"
def json = command.execute().text