curlpostjenkinsparameterized

passing parameter to jenkins job through curl POST not working?


I try to launch

curl -X POST -u "user:pass" -H Jenkins-Crumb:thecrumbnumber http://myjenkinsserver/jenkins/job/testjob/buildWithParameters?=PARAMETER=somenumber

which works by triggering a parametrized build, but the problem is no value is passed to the build (whats weird even when the token is set in the job, I can trigger the job without it). In jenkins, that job has a configured string "PARAMETER" with or without some default value, but never the parameter from the curl launch is passed. What I may be missing?


Solution

  • 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.