Jenkins job to trigger remotely using POSTMAN

Jenkins job to trigger remotely using POSTMAN .
http://xxxxxxxx:8080/job/job_name/buildWithParameters?

and parameters has been passed through JSON format through POSTMAN (in body) .
but values are not been picked by jenkins build .its empty

Hi All

Can somebody throw some light on this issue? this is a blocker for us and need some urgent help. Neither through post man nor curl command we are not able to pass the json body value to Jenkins job. when we tried with other APIs value are passed. But when it comes to Jenkins it is coming as empty. Any help in this really appreicated.

Thanks and rgds
-Kumar

I mean it’s a very vague question.we need what you tried (the curl command would be great). What were you expecting to happen (how do you know whatever is empty, how are you testing it) and what did happen(same what script were you using to prove this case)

Without providing those three peices of info, you’ll mostly get “man that sucks” unless someone happens to go through the exact same situation.

hi ,

thanks for the reply
in POSTMAN using POST method with API http://20.106.252.179:8080/job/Testapril2/buildWithParameters?

in body → raw (JSON) → {“vm1”: “IDOP”}

have used basic auth . facing no crumb issues .

jenkins build get triggered but values of vm1 is passed as empty .
please suggest

curl --location --request POST ‘http://xxxxxxx:8080/job/Testapril/buildWithParameters’ --header ‘Authorization: Basic xxxxxxxxxxxxx’ --header ‘Content-Type: application/json’ --data-raw ‘{“vm”:"IDOP-Test-Linux "}’

curl -X POST -H “Content-Type: application/x-www-form-urlencoded” --header ‘Authorization: Basic xxxxxxx’ --data-binary ‘{“key”:“json”,{“value”:{“parameter”:{“vm1”:“IDOP-Test”}}}}’ http://20.106.252.179:8080/job/Testapril2/buildWithParameters?

after firing this command , paramteres are not picked up by jenkins build

could you pls help

Please don’t start a new topic just because nobody is answering your previous one. Your options are to pay a vendor for help, or be patient with the volunteers giving you a hand.

Now I’ve never used parameters, but I think it takes form encoded post data, not raw JSON. A specific field might be JSON, but pretty sure you must post form encoded.

My recommendation is to use the webpage, then export the curl command from browser Network tools to import it into postman or run via CLI curl.

could you pls share sample curl command of the same

curl command we are trying from vm itself
curl --location --request POST ‘http://xxxx:8080/job/Testapril2/buildWithParameters’ --header ‘Authorization: Basic xxxxxx’ --header ‘Content-Type: application/x-www-form-urlencoded’ --data-urlencode ‘vm1=est’

‘vm1=est’ will work but not ‘vm1:est’

Yes, and --data-urlencode vm1=est should work for all the parameters. If you want to do it via postman you need to tell it to submit the parameters in the application/x-www-form-urlencoded form (not JSON). Maybe this helps