Groovy web console

subscribe to the feed Subscribe
to this
site
43652364326 (via #groovywebconsole)
tweet this snippet Tweet
this
script

43652364326

Published 10 months ago by 643623464326 with tags 643264236
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
// outside-variable list of jobs.
def listOfJobs = [ "job1", "job2", "job3" ]

def buildFlowString = """
// ... some variable setup

// inside-variable, dynamically generated list of jobs
def l = ${ "[\"" + listOfJobs.join("\", \"") + "\"]" }

// do something with my generated list l
"""

println "output:"
println buildFlowString