But jenkins job definitions are cached in memory. I have been fighting this forever since there are fields stored in this cache which are not generally available to the user.
In my case, what I want to do is direct the job to a particular slave, because there is pre-built workspace there that I want the build to run in + I have tested and that slave is not busy + that workspace is not currently in use by any other build.
This works the FIRST time you generate a job with a particular name. But the second time, jenkins has cached the name of the server that it successfully ran on. And you can not change it.
The jobs are all ci loop jobs, they run all the time, so I need to re-use names to avoid filling up the jobs directory with useless data.
And of course I can not reload Jenkins Configuration every time I get a ci loop build.
I tried to use a groovy script to force jenkins to reload the configuration for that job only and that did not work at all.