passing parameter to jenkins job through curl POST not working? passing parameter to jenkins job through curl POST not working? jenkins jenkins

passing parameter to jenkins job through curl POST not working?


I'm using:

curl -X POST -u "user" "http://myjenkins/path/to/my/job/buildWithParameters?GERRIT_REFNAME=feature/retry&goal=package"

here and it's working like a charm.

Watch out the "=" in front of the "PARAMETER" in the URL you pasted.


Using curl form parameters (-F param1=value1) solved the problem:

# parameters need to be passed via: -F param1=value1 -F param2=value2 ...curl -X POST http://myJenkins/job/testjob/buildWithParameters?token=<myToken> -F param1=value1

I'm using Trigger builds remotely and I had the same problem and none of the above helped. When I'm passing parameters via url parameters

# job is triggered but parameters are not propagatedcurl -X POST http://myJenkins/job/testjob/buildWithParameters?token=<myToken>&param1=value1

job is triggered but parameters are not propagated.


I used below command to pass Multiple parameter.

curl -X POST "https://myjenkins.com/job/jobname/buildWithParameters?token=developer&name=abc&userid=CFDH123&mail=abc@gmail.com"

Note: parameter names are case sensitive.