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 had the same problem and none of the above helped. When I'm passing parameters via url parameters job is triggered but url parameters are not propagated.
# job is triggered but parameters are not propagated
curl -X POST http://myJenkins/job/testjob/buildWithParameters?token=<myToken>¶m1=value1