Hi, I faced same issue. I need to update job and folders config.xml files manually and then get changes reflected in Jenkins. jenkins-cli reload-configuration was not working for jobs under folders. and "Reload Configuration from Disk" (in UI) was also not working.
TEMP SOLUTION (which worked for me):
create file: reload-configuration.groovy with content
import jenkins.model.Jenkins;
import hudson.model.AbstractItem;
import java.io.InputStream;
import java.io.FileInputStream
import java.io.File;
import javax.xml.transform.stream.StreamSource;
Jenkins.instance.getAllItems(AbstractItem.class).each{job ->
def configXMLFile = job.getConfigFile();
def file = configXMLFile.getFile();
if (file.exists()) {
InputStream is = new FileInputStream(file);
job.updateByXml(new StreamSource(is));
job.save();
println("Config reloaded: " + job.fullName);
}
}
And then run it with (add your auth method if needed):
java -jar jenkins-cli.jar -s https://${JENKINS_ADDRESS}/ groovy = < reload-configuration.groovy
This script goes through all items (jobs/folders) and updates their configs.
Please let me know if something is not clear in this explanation.
Just created a whole load of jobs in a Folder.
Did a mass change inside the config files manually ( using a script )
Reloaded config ManageJenkins->reload configuration from disc
Jenkins updated, jobs inside folders were not updated
above...
I'll go for the
*Jenkins Version 2.219 *
( tried it on an earlier version, thought I had done something wrong, only a few jobs so changed using Jenkins GUI .. and ignored it.)
All latest plugins installed
Raised it to Major
I have many jobs in folders and changing e.g. the clearcase branch in 20+ jobs using the Jenkins GUI is not amusing when a perl one liner does it almost instantly.