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

Receive Webhook requests POST content in build

      I have a multibranch pipeline setup with a Bitbucket server's repository with "Scan Multibranch Pipeline Triggers".

      For that, a webhook is automatically created in Bitbucket.

      Any push/pull request, branch builds are getting triggered also.


      Now I want to preform extra steps if the event is a Pull Request.
      For that, I'll need to read the Request Header/payload sent from Bitbucket.

      Is there any way to read/print it in Jenkins build logs?


      Multibranch -pipeline event logs:


      I can see the payloads & X-Event-Key(Request header) are getting sent from autogenerated webhook, but cannot find a way to read it.

       

          [JENKINS-70484] Receive Webhook requests POST content in build

          Rakesh created issue -
          Rakesh made changes -
          Attachment New: image-2023-01-24-20-55-04-812.png [ 59876 ]
          Rakesh made changes -
          Attachment New: image-2023-01-24-20-55-10-408.png [ 59877 ]
          Rakesh made changes -
          Description Original: I have a multibranch pipeline setup with a Bitbucket server's repository with "Scan Multibranch Pipeline Triggers".

          For that, a webhook is automatically created in Bitbucket.

          Any push/pull request, branch builds are getting triggered also.
          ----
          Now I want to preform extra steps if the event is a Pull Request.
          For that, I'll need to read the Request Header/payload sent from Bitbucket.

          Is there any way to read/print it in Jenkins build logs?
          ----
          Multibranch -pipeline event logs:

          !image-2023-01-24-20-41-30-015.png!
          ----
          I can see the payloads & X-Event-Key(Request header) are getting sent from autogenerated webhook, but cannot find a way to read it.

          !image-2023-01-24-20-46-47-214.png!

           
          New: I have a multibranch pipeline setup with a Bitbucket server's repository with "Scan Multibranch Pipeline Triggers".

          For that, a webhook is automatically created in Bitbucket.

          Any push/pull request, branch builds are getting triggered also.
          ----
          Now I want to preform extra steps if the event is a Pull Request.
          For that, I'll need to read the Request Header/payload sent from Bitbucket.

          Is there any way to read/print it in Jenkins build logs?
          ----
          Multibranch -pipeline event logs:

          !image-2023-01-24-20-55-04-812.png!
          ----
          I can see the payloads & X-Event-Key(Request header) are getting sent from autogenerated webhook, but cannot find a way to read it.

          !image-2023-01-24-20-55-10-408.png!

           
          Dyon made changes -
          Labels New: JENKINS-66581-PR-support

            Unassigned Unassigned
            rakeshpaul Rakesh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: