Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-68283

unable to triggers jenkins job using postman with body

      hi,

      i am unable to triggers jenkins job using postman . where API parameters is sent in body (json).

      Pls suggest

          [JENKINS-68283] unable to triggers jenkins job using postman with body

          divya P added a comment -

          using POST method to trigger 

          url fired is http://xxxxx:8080/buildwithParameters?

          and in POSTMAN body choosing raw-> JSON

          body content is as below

          {"param1":"value"}

           

          pls help to fix 

          divya P added a comment - using POST method to trigger  url fired is http://xxxxx:8080/buildwithParameters? and in POSTMAN body choosing raw-> JSON body content is as below {"param1":"value"}   pls help to fix 

          divya P added a comment -

          after using Above POST . jenkins build is triggered but param value is not picked up by jenkins.

          is there any way to read values in  BODY and put to param section

          we are working on passing on dymanic json which contians param

          divya P added a comment - after using Above POST . jenkins build is triggered but param value is not picked up by jenkins. is there any way to read values in  BODY and put to param section we are working on passing on dymanic json which contians param

          Markus Winter added a comment -

          see https://wiki.jenkins.io/display/JENKINS/Remote+access+API howto trigger job with params with json

          In Postman send the POST request with x-www-form-urlencoded

          and following key value pair:

          key = json

          value = {"parameter": [{"name": "param1", "value": "pvalue"{color:#212121}}]}

          Markus Winter added a comment - see https://wiki.jenkins.io/display/JENKINS/Remote+access+API howto trigger job with params with json In Postman send the POST request with x-www-form-urlencoded and following key value pair: key = json value = {"parameter": [{"name": "param1", "value": "pvalue" {color:#212121}}]}

          Markus Winter added a comment -

          This is in no way related to the parameterized remote trigger plugin

          Markus Winter added a comment - This is in no way related to the parameterized remote trigger plugin

          divya P added a comment -

          could you pls share curl command

          curl --cipher 'DEFAULT:!DH' --location --request POST 'http://20.106.252.179:8080/job/Testapril2/buildWithParameters? \
          --header 'Accept: application/x-www-form-urlencoded' \
          --header 'X-Rundeck-Auth-Token: xxxxxxxxx' \
          --header 'Content-Type: application/json' \
          -d key=json \
          -d value={"parameter": [

          {"name": "vm1", "value": "TEST-Idop"}

          ]}";

          divya P added a comment - could you pls share curl command curl --cipher 'DEFAULT:!DH' --location --request POST 'http://20.106.252.179:8080/job/Testapril2/buildWithParameters? \ --header 'Accept: application/x-www-form-urlencoded' \ --header 'X-Rundeck-Auth-Token: xxxxxxxxx' \ --header 'Content-Type: application/json' \ -d key=json \ -d value={"parameter": [ {"name": "vm1", "value": "TEST-Idop"} ]}";

          Markus Winter added a comment -

          curl -X POST http://localhost:8080/job/paramtest/build --user user:pwd --data-urlencode json='{"parameter": [

          {"name":"MESSAGE", "value":"123"}

          ]}'

          Markus Winter added a comment - curl -X POST http://localhost:8080/job/paramtest/build --user user:pwd --data-urlencode json='{"parameter": [ {"name":"MESSAGE", "value":"123"} ]}'

          divya P added a comment -

          thanks through curl it worked .

           

          could you pls help in POSTMAN 

          parameters i need to send in body raw JSON

          {"name":"MESSAGE", "value":"123"}

          divya P added a comment - thanks through curl it worked .   could you pls help in POSTMAN  parameters i need to send in body raw JSON {"name":"MESSAGE", "value":"123"}

          Markus Winter added a comment -

          see JENKINS-68292 where I posted screenshots of the postman. It doesn't work with raw.

          Markus Winter added a comment - see JENKINS-68292 where I posted screenshots of the postman. It doesn't work with raw.

            Unassigned Unassigned
            divyap divya P
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: