In case anyone is searching here is my own answer to this question - there 
is a 'parameter' command in the Pipeline DSL designed for this exact 
purpose, but there are some gitcha's

* First, the code generator generates broken code - so do not trust it. 
Luckily main issue is easy to fix by replacing the "parameter [...]" syntax 
with "parameter([...])" syntax - but there are other issues - so doublecheck

* Then there is the fact that the request for parameters is set from the 
job itself, so essentially you are setting parameters for the NEXT job, not 
for the one that is running. This actually makes sense, once you wrap your 
head around it

* Ans this is a very nasty one - if you make a mistake in your parameter() 
call that leads to invalid  config (for example a Choice parameter with no 
choices) you are in trouble. Because to fix it, you have to run a job and 
the job will not run until you fix the problem. I ended up having to delete 
the entire MB job to fix it.

-M


On Friday, August 26, 2016 at 12:52:49 PM UTC-7, Michael Lasevich wrote:
>
> Is it possible to add parameters to a multibranch pipeline job? 
>
> I am happy with the job running with some sorts of default values when 
> running automatically, but it would be nice to be able to have Jenkinsfile 
>  (or even manually) define parameters that could be optionally provided 
> when running the job manually.
>
> Thanks,
>
> -M
>
>
>

-- 
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/1e584aef-6a59-4044-80d8-38854230f83f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to