Issue
I have tried this command in Jenkins pipeline script
sh ‘curl ${BUILD_URL}consoleText —-output ${WORKSPACE}/logs/log.txt’
But it’s not resolving the WORKSPACE variable.Any idea how to proceed.
Solution
You can use it in below way:
def Workspace=env.WORKSPACE
sh "<Yourcommand> ${Workspace}"
Answered By - Altaf