Hi Vicki,
According to https://wiki.jenkins.io/display/JENKINS/Parameterized+Build, for 
buildWithParameters you should use URL query params to pass the values.

To use your example:

curl -v https://jenkins/job/JobName/buildWithParameters?targ_env=dev  --user 
userName:userToken


Regards,
Daniel

From: Vicki Kozel
Sent: 10 January 2019 03:37
To: Jenkins Users
Subject: CLI command to start jenkins job with default and overridenparameters

Hello,
I am having trouble with combining default and overriden parameters when 
invoking jenkins jobs through remote CLI command.  

It  looks like the following invocation passes command line parameters to a job 
just fine, but ignores the default parameters:
curl -v https://jenkins/job/JobName/build -F json='{"parameter": [{"name": 
"targ_env", "value": "dev"}]}' --user userName:userToken


and the invocation on buildWithParameters api does the opposite - ignores the 
passed parameters and sets all the defaults correctly:

curl -v https://jenkins/job/JobName/buildWithParameters -F json='{"parameter": 
[{"name": "targ_env", "value": "dev"}]}' --user userName:userToken

Is there an API that can combine two sets of parameters?

Thank you!!

-- 
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/27053cad-e82f-4053-b76c-ebfdf5781877%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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/5c37157e.1c69fb81.a9c68.17a1%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to