I think it was rather overall jenkins question. I've found an answer in 
jenkins code:

project.addProperty(new ParametersDefinitionProperty(
    new StringParameterDefinition("A", "aaa", "Desc"),
    new StringParameterDefinition("C", "ccc", "Desc2"),
    new StringParameterDefinition("B", "AAAA", "Desc3")
));



W dniu środa, 15 lipca 2015 11:06:07 UTC+2 użytkownik Arek Skalski napisał:
>
>
>
> I have a code snippet to create an empty workflow project.
>
> def parent = Jenkins.getInstance()
> def name = "Test_Name"
> def project = parent.getItem(name)
>
> if (project == null) {
>     project = parent.createProject(WorkflowJob.class, name)
> } else print "[INFO] Project $name already exists. Will be updated."
> project.setDescription("my description")
> project.setDefinition(new CpsFlowDefinition("print \"test\""))
> project.addTrigger(new hudson.triggers.TimerTrigger("0 20 * * *"))
> project.setBuildDiscarder(new hudson.tasks.LogRotator("", "5", "", ""))
> project.save()
>
> I would like to add parameters to that project, something like:
>
> project.addParameter(new StringParameter("name", "default", "description"))
>
> but I cannot find a way how to actually do it.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/4478792e-6882-401c-930c-6316e3140cd4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to