Jenkins - choice parameter - mysql database query return list
<p>A new user to Jenkins. I am attempting to replace an old build system that used a  website in which part of it has a drop down menus that gives a list of old builds using a SELECT query in mysql. This allows the user to deploy or delete the build as needed.</p>

<p>The goal is to setup a choice parameter in Jenkins (there are many difference choice plugins -Dynamice, Active, Extended, etc., I am not sure which one to use) so that the user can select the build from a list.</p>

<p>Working with the Scriptler plugin, I am able to run the following code (edited) and it returns a list of the builds, which is what I want:</p>

<pre><code>import groovy.sql.Sql
def sql = Sql.newInstance('jdbc:mysql://localhost:3306/test', 'root', '', 'com.mysql.jdbc.Driver')
String sqlString = "SELECT BVersion FROM BuildTable WHERE Branch = '${BUILD_NAME} ORDER BY BuildDate DESC Limit 10;"
sql.eachRow(sqlString){ row -&gt;  
    println row[0]  
}
</code></pre>

<p>I want to do variable replacement as well, so that the user choose a ${BUILD_NAME} in the choice above and this will dynamically return the build list based on that choice.</p>

<p>However when I add the code either as scriptler code or groovy script, I find that neither works and I get a blank field. What am I missing to get this to return a choice, single choice per line??</p>

<p>Thanks for any assistance you may offer. 
D</p>