Disable Jenkins Job from Another Job

后端 未结 7 1419
夕颜
夕颜 2020-12-16 01:20

Is there a way in Jenkins (Hudson) to disable a job from another job?

Basically we have a build environment that does the standard building/testing. We also use the

7条回答
  •  情歌与酒
    2020-12-16 01:40

    Recent version of Jenkins (2 and over) change the method name.
    Just replace disable() with setDisabled(boolean)

    Found that this worked for me:
    Jenkins.instance.getItem("jobname").setDisabled(false)

提交回复
热议问题