This issue originates from this issue in Generic Webhook Trigger Plugin: https://github.com/jenkinsci/generic-webhook-trigger-plugin/issues/107
The reporter is using declarative pipeline.
The user wants to get the credential, secret text, and use it when configuring triggers. More specifically as value of the 'token' configuration parameter in the plugin.
Something like this:
The problem is that the credential, or variables form the environment block, is not available in the triggers block.