Search code examples
javajenkinsjelly

Configure a one-time value(checkbox) that resets itself to default?


I'm writing a jenkins plugin and want to have a checkbox, that will allow me to, in my case, tell Jenkins to overwrite the build it's doing, but only once.

So I have a 'Overwrite' checkbox, I check it and run a build, lets say #3. I does the overwrite thing I want, but on build #4 it does not and the checkbox will be unchecked again.

Is it possible to change the setting in job configuration from code? Reset it to default or something similar?

Thanks, Mike


Solution

  • To answer talex question: I have a job that runs daily with some default settings. From time to time, I may want to trigger it manually, with different settings. It is trouble, to go into Configuration Page, change settings, trigger the job and after it's done, go back to config to change back.

    Thank you all, I was able to accomplish this functionality with "Parameterized Build".

    I guess the solution from SniperJoe would work just as well, but this was easier and faster and I didn't have much time for it.