Reputation: 16982
I see the below error when I try to create a shell variable in my JenkinsFile. How can I get around this issue?
groovy.lang.MissingPropertyException: No such property: file_name for class: Script1
sh"""
file_name=`echo ${env.JOB_NAME} | sed -e 's/\\//-/g'`
echo "file name =" $file_name
"""
Upvotes: 0
Views: 770
Reputation: 16982
This post helped me get the issue fixed. I had to do the below -
sh"""
file_name=`echo ${env.JOB_NAME} | sed -e 's/\\//-/g'`
echo "file name =" \$file_name
"""
Upvotes: 1