有同样的问题并且在文档中找不到答案,所以我现在按照这个例子使用系统groovy脚本。
def job = Hudson.instance.getJob('MyJobName')def anotherBuildtry { def params = [ new StringParameterValue('FOO', foo) ] def future = job.scheduleBuild2(0, new Cause.UpstreamCause(build), new ParametersAction(params)) println "Waiting for the completion of " + HyperlinkNote.enpreTo('/' + job.url, job.fullDisplayName) anotherBuild = future.get()} catch (CancellationException x) { throw new AbortException("${job.fullDisplayName} aborted.")}我正在使用Jenkins 2.116和Groovy插件2.0



