Issue with Generic Webhook Trigger plugin

I am trying to use Generic Webhook Trigger plugin in Jenkins to trigger build in case any PR is raised on my GitHub repo. For starters I defined a variable “current_status” mapping it to “action” field within the json payload to be received from GitHub. While the build is getting triggered on raising a PR but the value for current_status is coming as null. The content-type for my GitHub webhook is “application/json”

Variable inside Jenkins

The GitHub payload generated against the PR event has action field in it : “action”: “opened”, But when I try to print this variable using println “${params.current_status}” in my pipeline, the value is printed as null.

Also when I try to execute a step based on the value of the variable using

when {
expression { return params.current_status == “opened” }
}

the stage is skipped even though the value as per the action in the GitHub payload is “opened”. Is there any other way to refer to these parameters?

Tried to make the pipeline parameterized, defined a string variable with the same name (current_status) as was defined in my Generic Webhook Trigger section. Then referred to the parameter as environment variable within my Jenkinsfile and it worked. Not sure if this is the correct way to do it since it seems to be a workaround