以下REST查询将返回上次成功构建作业的参数:
https:// localhost/job/test1/lastSuccessfulBuild/api/json
我有兴趣检索此构建的一个参数,即BUILD_VERSION:
{ "_class": "org.jenkinsci.plugins.workflow.job.WorkflowRun", "actions": [ { "_class": "hudson.model.CauseAction", "causes": [ { "_class": "hudson.model.Cause$UpstreamCause", "shortDescription": "Started by upstream project \"continuous-testing-pipeline-for-nightly\" build number 114", "upstreamBuild": 114, "upstreamProject": "continuous-testing-pipeline-for-nightly", "upstreamUrl": "job/continuous-testing-pipeline-for-nightly/" } ] }, { }, { "_class": "hudson.model.ParametersAction", "parameters": [ { "_class": "hudson.model.StringParameterValue", "name": "BUILD_VERSION", "value": "1.1.15"
有没有办法直接使用REST Api检索BUILD_VERSION(1.1.15)或者我是否必须手动解析json字符串?谢谢