We have special Built-In Jenkins Variables for a Job like ${JOB_NAME}, ${JOB_URL}, ${BUILD_NUMBER} etc, which can be accessed inside a Pipeline script (both Scripted and Declarative). Although, we can use these variables directly, I would like to know whether these are a part of an Array variable like env, so that I can use it to loop and get the variables instead of referencing them specifically using their names. I want to use this array inside my pipeline. It will be helpful, if someone can also provide an example. I tried searching a lot and also tried various ways, but couldn't find anything.
Please help.