I am trying to change the branch of git scm inside jenkins jobs using groovy scipt. But is always getting set to master no matter what values I pass.
for (project in all_jobs){
scm = project.scm;
//def oldScm = item.getScm()
"repositories: ${scm.repositories.collectMany{ it.getURIs() }}")
scm.branches = "some-branch"
println "Test" + scm.branches
}
It prints the changed value but not getting saved