Hello,

I am trying to display json file content as multiselect within Choice 
Active Parameter.

This is my code:

//import groovy.json.JsonSlurperClassic
import groovy.json.JsonSlurper

//def parseJsonText(String jsonText) {
//  final slurper = new JsonSlurperClassic()
//  return slurper.parseText(jsonText)
// }



node('master') { 
    

// def fichero = readFile('/var/jenkins_home/workspace/free/dos.json')
// configuracion = parseJsonText(fichero)
//  println configuracion



def jsonSlurper = new JsonSlurper()
def object = jsonSlurper.parseText('{ "server": "axn","server2":"azn" }')
println object 

} 


I have tried JsonSlurper and JsonSlurperClassic libraries.
If the parsing of my json is in text inside the script it works fine, but 
if I retrieve the json content from a file it doesn't work.
Both codes are tested as pipelines and return the same result.

Any idea?

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/74f81861-4303-4e4a-a58a-4c7a9e6c4fbfo%40googlegroups.com.

Reply via email to