Open halkeye opened 2 years ago
Hi, I'm unable to get the expected results following the doc https://www.jenkins.io/doc/book/using/remote-access-api/#submitting-jobs.
I'm trying to send a POST request to a build with parameters.
PARAMETRIZED_URL="${BUILD_URL}?delay=0sec&token=${BUILD_TOKEN}"
PARAMETRIZED_URL+="&PARAM_X=${PARAM_X_VAL}"
PARAMETRIZED_URL+="&PARAM_Y=${PARAM_Y_VAL}"
curl --silent --request POST \
--user ${USERNAME}:${USR_API_KEY} \
${PARAMETRIZED_URL} \
--include --output response
curl --silent --request POST \
--user ${USERNAME}:${USR_API_KEY} \
--data delay='0sec' \
--data token="${BUILD_TOKEN}" \
--data PARAM_X="${PARAM_X_VAL}" \
--data PARAM_Y="${PARAM_Y_VAL}" \
"${BUILD_URL}" \ # this is "${JENKINS_JOB_URL}/buildWithParameters"
--include --output response
Both of them trigger the job, but fail to send the parameters. In the console output I can see:
...
time="2022-11-02T07:33:44Z" level=warning msg="The \"PARAM_X_VAL\" variable is not set. Defaulting to a blank string."
time="2022-11-02T07:33:44Z" level=warning msg="The \"PARAM_Y_VAL\" variable is not set. Defaulting to a blank string."
...
Where am I going wrong?
On further review, there are more things wrong with this content, so well out of scope for this PR.
_Originally posted by @daniel-beck in https://github.com/jenkins-infra/jenkins.io/pull/4874#discussion_r796182858_