Access the Value of BUILD_NUMBER/PROMOTED_NUMBER

15 views
Skip to first unread message

avinash....@gmail.com

unread,
Nov 14, 2016, 1:18:18 PM11/14/16
to Jenkins Developers
Hi Folks,

I am using Promoted Build plugin. And using some custom groovy scripts to validate the build! I wanted to access the value of BUILD_NUMBER from the groovy script. Can anyone suggest me how i can achieve this?

Another thing i am writing println statement in this groovy script but its no where getting logged. Any suggestion to debug the script flow how can i log the info ?

Thanks  

Rachel Moreno

unread,
Nov 15, 2016, 4:28:43 PM11/15/16
to Jenkins Developers
Hi,

You can get that value with:

build.number

For example (without any really valid purpose):

return (build.number > 1)

Any script evaluation errors will be redirected to the application log.

I hope be useful.

Best regards,
Rachel
Reply all
Reply to author
Forward
0 new messages