Trying to use a Reactive Reference Parameter, it's not quite working

34 views
Skip to first unread message

Adam von Nieda

unread,
Dec 18, 2018, 11:48:45 AM12/18/18
to jenkins...@googlegroups.com

   Hi folks,

   I’ve got two parameters in my job, the first is a simple “Choice parameter” called “Choose", which has the following choices

dev
test

   The second is an “Active Choices Reactive Reference Parameter” called “Hostname", which uses the following Groovy script to return a hostname. It references the above parameter. 

if (Choose.equals("dev")) {
  return "hostname1"
} else if (Choose.equals("test")) {
  return "hostname2"

   If I set the choice type to “Formatted HTML”, I can see the Hostname parameter update on the screen when I switch back and forth from dev to test. So the Groovy script is working. But when I try to reference the ${Hostname} parameter later on, it doesn’t appear to be set. Is there something I’m missing? 

   I’ve attached a couple of screen shots to show my configuration.  Basically I’m trying to do an if / then on a parameter, setting another. If there’s a better way to do it, I’d love to hear it :) 

   Thanks very much!

      -Adam vonNieda



Ioannis Moutsatsos

unread,
Apr 13, 2019, 11:55:07 AM4/13/19
to Jenkins Users
An AC Reactive Reference formatted as HTML should return valid HTML and an element with name="value" Only then the value of the element will be passed to the build.
Please, read 'Passing Reactive Reference Values to the build ' in the AC wiki page: https://plugins.jenkins.io/uno-choice 

Hope this helps
Reply all
Reply to author
Forward
0 new messages