Change STRING PARAMETER default Value in Existing Job from Value1 to Value2

2,065 views
Skip to first unread message

Mahendra Singh

unread,
Mar 26, 2015, 1:21:58 PM3/26/15
to job-dsl...@googlegroups.com
Hi All,
I have a Jenkins Job (TestJob) which takes one BUILD STRING parameter, say PARAMETER1 which has default value as VALUE1.

I want to update the same job (TestJob) with help of DSL Job Script in a Seeder Job( SeedJob). Want to change the default value from VALUE1 to VALUE2.
Can you please help me as I am new with Groovy Script.

Regards,
Mahendra

Mahendra Singh

unread,
Mar 27, 2015, 4:40:46 AM3/27/15
to job-dsl...@googlegroups.com
When I am using 
job{
using 'Testjob'
     parameters {
       stringParam("PARAMETER1", "VALUE2", "My New Discription")
    }
}

It says 'No name is defined in seed job'
Please help me to get this work.

Daniel Spilker

unread,
Mar 30, 2015, 8:57:58 AM3/30/15
to job-dsl...@googlegroups.com
The job name is mandatory parameter as mentioned in the docs: https://github.com/jenkinsci/job-dsl-plugin/wiki/Job-DSL-Commands#dsl-methods

job('my-job') {
    using 'Testjob'
    parameters {
        stringParam("PARAMETER1", "VALUE2", "My New Discription")
    }
}

Daniel

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/f8ce35c9-9e12-44a0-9ad6-4697ddee0892%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Mahendra Singh

unread,
Mar 31, 2015, 2:00:40 AM3/31/15
to job-dsl...@googlegroups.com
Thanks Daniel for the reply.
If I give job name then it will create a jenkins job with the given name. I dont want to create Jenkins job everytime. I want to update the existing job parameter value.
Any idea to implement that. If I gave same existing job name then it is creating a new parameter rather than updating it.
Reply all
Reply to author
Forward
0 new messages