How to get the job name on a groovy dynamic parameter in Jenkins -


i need name job in example, have code previous value of build parameter code

jenkins.model.jenkins.instance.getitem("nameofjob").lastbuild.getbuildvariables().get("nameofparameter"); 

the name of job hard coded, need name name of current job, how can't do?

thank you

groovy dynamic parameters not have access usual environment variables rest of jenkins job privy to.

here working hack job name:

def build = thread.currentthread().tostring() def regexp= ".+?/job/([^/]+)/.*" def match = build  =~ regexp def jobname = match[0][1] 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -