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?
I used below command to pass Multiple parameter.
Note: parameter names are case sensitive.
I'm using:
here and it's working like a charm.
Watch out the "=" in front of the "PARAMETER" in the URL you pasted.
Please try something like:
Looks like there is a typo in Jenkins Confluence page while calling Jenkins url passing parameters as JSON payload.. https://wiki.jenkins.io/display/JENKINS/Remote+access+API Tried with url suffix as build instead of buildWithParameters and it is working..
curl -X POST -u "user:token/password" "http://myjenkins/path/to/my/job/build --data-urlencode json='{"parameter": [{"name":"GERRIT_REFNAME", "value":"feature/retry"},{"name":"goal", "value":"package"}]}'
I'm also trying to post but the following curl command, but it doesn't post.
It creates the job but doesn't pass in the variables. Not sure, what I'm doing incorrectly.
When I tried
OR
Both triggered Jenkins Job > 1_TODO_Get_Submit_Request_With_Dependency_Test but the parameter in Jenkins log showed default value for parameter
REQUESTID = -1
.What is problem with Jenkins or CURL url ?