Windows上的詹金斯,声明式管道。假设下面的Groovy脚本在我的管道的script()块内:
import groovy.json.JsonSlurper
def request = httpRequest "https://localhost/job/MyBuild/lastBuild/api/json"
def requestJson = new JsonSlurper().parseText(request.getContent())
// How do I set the value of a pipeline variable to this: requestJson['result']