[英]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.