!! Need urgent help with Active Choices Reference Parameter !!

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

!! Need urgent help with Active Choices Reference Parameter !!

Nishant Jha
Hi Team,

I am using opensource Jenkins 2.235.3 version on Centos 7.7 machine with Active Choices Plug-in Version 2.4

The problem I am running into is very strange

I am using a groovy script to dynamically populate parameters and I am using Active Choices Reactive Parameter. In that plugin I have written a following groovy script

Groovy Code:

this.class.classLoader.addURL(new URL("file:///var/lib/jenkins/.groovy/grapes/org.yaml/snakeyaml/jars/snakeyaml-1.17.jar"))
def url = '[hidden email]:csd/deployment.git'
def envlist = ['/bin/bash', '-c', ' ssh-add  /var/lib/jenkins/.ssh/id_rsa_git; cd /var/lib/jenkins/services/; git archive --remote='+ url +' master inventory | tar xvf -' ].execute().
envlist.waitFor()
def yaml = Class.forName("org.yaml.snakeyaml.Yaml").newInstance()
def config = yaml.load(new FileReader("/var/lib/jenkins/services/inventory/${SERVICES}.yml"))
return config.all.children."${SERVICES}".children.keySet()

NOTE: SERVICES is another defined parameter

Whereas when I use Active choice reactive reference parameter with same code:

Same groovy code works and prints out the following result
"[functional, staging_stable, pilot_stable, prod_stable]"


When I use script console in manage jenkins, it runs fine and prints me the same result
Result: [functional, staging_stable, pilot_stable, prod_stable]


When I check web console logs, I get 

"Calling Java server code to update HTML elements... unochoice.js:154:17
Values returned from server: [[],[]] unochoice.js:157:21


How can I proceed with debugging, I want to only use Active Choices Reactive Parameter?
I have attached the screenshot to show how one is populated and one is not. Not enough to go through and debug this problem over the internet.
Can somebody please help?

Thankyou
Nishant

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2d7253f5-79c5-4d15-b502-0f7dcdec5ce8o%40googlegroups.com.

Screen Shot 2020-07-27 at 11.40.44 PM.png (50K) Download Attachment