FranAguiar
FranAguiar

Reputation: 647

Jenkins Active Choices Plugin input text box don't return anything. Why?

This is my actual configuration

Domain Param Configuration

Jenkins Job

When I type the desired domain there is nothing in domain's variable. Any idea what's going on? I'm totally newbie with groovy script.

Thanks.

BTW, my little and totally useless groovy script:

if (Environment.equals("pro")){
  inputBox="<input type='text'>"
  return inputBox
}

Upvotes: 2

Views: 15752

Answers (3)

ankur-AJ
ankur-AJ

Reputation: 29

i found value should is being saved when only we pass name='value' attribute to build as parameter as per doc .

Upvotes: 1

Adrian Chitacu
Adrian Chitacu

Reputation: 63

So I was struggling with the same thing just now and came upon this question so might as well post the solution that worked for me :)

My paramater name in jenkins is "Partner"

My groovy script:

inputBox = "<input name='value' class='setting-input' type='text'>"
return inputBox

It seems that the value inputed is stored in a variable that has the paramater name; Soo... if you wana use the Value inputed just use the variable like this ${Partner} or %Partner% (depending on where you want to use it);

Hope it helps someone :)

Upvotes: 6

TheEllis
TheEllis

Reputation: 1736

How are you evaluating that there is no value passed on from the Domain input box? It looks like the problem is that you aren't assigning a name attribute to your input box, thus I'm not sure how you would retrieve the value. Try <input name='domain' type='text'/> and then see if the domain variable has a value.

I see that the Active Choice Plugin also has a "Choice Type" of input box, but I'm not sure if that fits what you are trying to do.

Upvotes: 0

Related Questions