Gimbo
Gimbo

Reputation: 307

Accessing Jenkins job parameter variable in Extensible Choice using System Groovy Choice Parameter

I'm using Extensible choice to define two parameters: NEXT_CHANGE and NEXT_RELEASE as follow:

enter image description here

but when i tried to use NEXT_CHANGE variable in NEXT_RELEASE groovy script it doesn't work. i tried both these methods with no success:

def hardcoded_param = "NEXT_CHANGE" 
def resolver = build.buildVariableResolver 
def hardcoded_param_value = resolver.resolve(hardcoded_param)
return [hardcoded_param_value]

and

def thr = Thread.currentThread() 
def build = thr?.executable 
def envVarsMap = build.parent.builds[0].properties.get("envVars")
eturn [envVarsMap.get('NEXT_CHANGE')]

any thought?

Upvotes: 2

Views: 5270

Answers (1)

Yuri G.
Yuri G.

Reputation: 4648

You are trying to use this plugin in wrong way. Look at this question and its answer

Upvotes: 1

Related Questions