0

Am trying to rename 300 jenkin Jobs- lables through a Groovy script

am not able to find any links or examples to refer and do

can you please help ?

a template or the code snippet referring will be much useful

I tried using hudson.model.* - not sure which method to use

I used hudson.instance.items to change the job name but not able to find one to change the lable in a job

changelable(items){

    for( item in items) {
        println(item.name)

        def job = "test"

        if (item.name == job ){
            item.name = job +""+modified
        }
        println(item.name)
    }
}
smk
  • 1
  • 1
  • Isn't this a duplicate of http://stackoverflow.com/questions/14603615/renaming-job-in-jenkins-hudson ? – sensei Oct 06 '16 at 13:12
  • @sensei No , What i meant to is to change the lable inside the job not the job name ... we have a label inside a job and i need to change that label through a script for about 300 jobs – smk Oct 07 '16 at 07:22
  • Does any1 have a solution of this ? or know the api where i can retirve the label inside a jenkins job – smk Oct 17 '16 at 10:17

0 Answers0