Jenkins Global environment variables in Jenkinsfile
How do I invoke Global environment variables in Jenkinsfile? For example, if I have a variable - name:credentialsId value:xxxx-xxxx-xxxxx-xxxxxxxxx How do I use it in the groovy script? I tried ${credentialsId} , but it didn't work. It will just give error: java.lang.NoSuchMethodError: No such DSL method '$' found among steps [ArtifactoryGradleBuild, ........ In a Jenkinsfile, you have the " Working with the Environment " which mentions: The full list of environment variables accessible from within Jenkins Pipeline is documented at localhost:8080/pipeline-syntax/globals#env, The syntax is $