1

I have a Jenkins build job where I am passing few parameters while triggering the job. I need to use some of those parameters in a Groovy script. How to do that?

My Parameter is BUG_ID and its value is 2010

I am accessing as shown below

print ('BUILD_NO is '+System.getenv('BUG_ID'))
print ('BUILD_NO is ${BUG_ID}')
print ('BUILD_NO is ${env.BUG_ID}')

All returning null

Nikhil K R
  • 677
  • 1
  • 9
  • 19

1 Answers1

1

Use double quotes:

print ("BUILD_NO is ${BUG_ID}")
Thami Bouchnafa
  • 1,987
  • 1
  • 15
  • 21