Extract the body of a webhook in Jenkins

Hi Jenkins community!

I’m working on a pipeline that receives webhook payloads and I need to extract and process the request body. I’m struggling to figure out the best approach to capture and parse the webhook data within my Jenkins pipeline.

What I’m trying to achieve:

  • Capture the full JSON payload from incoming webhooks
  • Parse specific fields from the webhook body
  • Use this data to trigger different pipeline actions based on the payload content

What I’ve tried so far:

  • Looking at env variables but not seeing the full payload
  • Tried using params but that seems to only capture query parameters
  • Attempted to use currentBuild.rawBuild but getting access issues


This is the feature im trying to use