It does not works for me. This is the script: println myVar
and this is the error: groovy.lang.MissingPropertyException: No such property: myVar for class: WorkflowScript I think I need to acces it from environment but I don't know how. El miércoles, 20 de mayo de 2015, 20:23:34 (UTC+2), Yasir Saleem escribió: > > You can get them by simply calling by name like: > > testVar = myVar > > Where 'testVar' is var defined in the flow.groovy (or whatever name you > gave) script, and 'myVar' is env or parameters (input or choice etc). > > if you don't use 'def' they can be global variable, used inside that your > flow.groovy class. > > > > On Monday, May 18, 2015 at 4:24:25 AM UTC-4, Carlos Lucas wrote: >> >> Hi, >> >> I have some environment variables defined in Jenkins configuration ( >> Manage jenkins >> System configuration >> Global properties ) but I am no >> able to get their value on a workflow script. >> >> I tried with* System.getenv()["myVar"],* *currentBuild.getEnvironment(null), >> env.myVar * and accessing like a normal variable but nothing works. Do >> you know how can I do it? >> >> Thank you! >> > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9c15cbdd-2d37-4f43-bf44-0ba9eeb673f4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.