Morgan Blackthorne (2017-05-12 20:05):
So I'm a little confused as to setting job to a value, but then
referencing build.setDescription afterwards... or should that be
job.setDescription?
// loop over jobs (possible also in Script Console)
for (item in hudson.model.Hudson.instance.items) {
println("Saving " + item);
item.save();
}
Do I need to save them all, or just the one I modified? Like job.save(); ?
I don't think you need to save jobs after doing something with them.
That was just an example action in the loop. Just test your commands in
the script console and see if it works. Make sure you you have backup of
at least config.xml of your jobs ;-).
Regards,
Nux.
PS: I actually use this loop in our Jenklins installation. I do this to
re-fresh configs after plugin updates. Doing `save` forces plugins to
verfiy job config and possibly insert defaults.
--
You received this message because you are subscribed to the Google Groups "Jenkins
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/2e786696-48d8-87ca-7d1e-1b2c732bc70b%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.