简体   繁体   English

如何通过Jenkins API设置作业的“上次成功构建”值?

[英]How to set “Last successful build” value for a job through Jenkins API?

Regarding the data displayed in the "Permalinks" section of the Job Status page in Jenkins, I know there are methods to get the values. 关于Jenkins的“作业状态”页面的“固定链接”部分中显示的数据,我知道有一些获取值的方法。 For example ... 例如 ...

jenkins.instance.getItemByFullName("<job>").getLastSuccessfulBuild()

However, I can't find any method to change the "Last successful build" value on the screen. 但是,我找不到在屏幕上更改“上次成功构建”值的方法。
Editing the symbolic link $HOME/.jenkins/jobs/<job>/builds/lastSuccessfulBuild , then running jenkins.instance.doReload() does not cause the gui screen display to be updated. 编辑符号链接$HOME/.jenkins/jobs/<job>/builds/lastSuccessfulBuild ,然后运行jenkins.instance.doReload()不会使gui屏幕显示更新。

Is there a way to do this through the API? 有没有办法通过API做到这一点?

Thanks. 谢谢。

This is the call for get the value using the API: 这是使用API​​获取值的调用:

http://$host/job/$jobname/lastSuccessfulBuild/api/json HTTP:// $主机/工作/ $作业名称/ lastSuccessfulBuild / API / JSON

You can try to modificate the json and to do a POST with the new Json after. 您可以尝试修改json,然后再使用新的Json进行POST。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过API获取正在运行的jenkins作业的进度条数据 - how to get progress bar data for a running jenkins job through the API 通过api发送内部版本号作为json参数,获取詹金斯工作的控制台输出 - Get console output of a jenkins job by sending the build number as a json parameter through api 如何取消jenkins中的构建队列作业,这些作业不是由jenkins启动的,而是通过REST API在其构建队列中 - how to cancel build queue jobs in jenkins, which are not started by jenkins and are in its build queue through REST API 列出过去一年的 Jenkins 作业构建详细信息以及触发构建的用户 - List Jenkins job build detials for last one year along with the user who triggered the build 通过Ajax使用远程API触发参数化作业构建 - Trigger parametrized job build using remote API through ajax Jenkins / API如何读取构建信息https - Jenkins/ API how to read build info https 如何通过REST API停止Jenkins的构建? - How to stop a build in Jenkins via the REST api ? TeamCity - 如何通过rest api获取每个项目最后完成的构建列表? - TeamCity - How do you get a list of the last finished build of each project through rest api? 如何通过api获取所有jenkins用户 - how to get all the jenkins users through api 使用Groovy Jenkins API更新Jenkins作业 - Updating a Jenkins job with the Groovy Jenkins API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM