It seems when I updated a Job configuration with Groovy in the Script console it didn't really take effect.
def jenkinsInstance = jenkins.model.Jenkins.getInstance()
def developmentView = jenkinsInstance.getView("Development")
developmentView.getItems().each { project ->
def trigger = new hudson.triggers.SCMTrigger("H/5 * * * *")
project.addTrigger(trigger)
project.save()
}
I later checked one of my project and found it hadn't checked Git for any changes for some time. In fact it was well over 5 minutes since last check. I triggered a build manually and it found new changes. I went into Configuration of that project, checked the settings and they where good SCM trigger was set to 5 minutes. I then saved the project configuration (even though I didn't change anything). After I did that I later checked the SCM log and it did from that moment forward check Git every 5 minutes for changes.
So it looked like the Groovy script I executed didn't take effect, even though it actually did update the configuration properly.
Am I missing an extra step after project.save()?