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()?

-- 
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/ea96dd9a-4b48-4fcf-a6b9-0f4d0dc163e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to