Active Choices requires that the returned value from the script is a list
or a map. Each element then becomes a selectable option.
Assuming that each line of your text file contains an option you want to
display, try something along these lines for the Active Choices groovy
script:
def choices=[]
textFile= new File("C:/temp/applicationlist.txt")
textFile.eachLine{
choices.add(it)
}
return choices

On Fri, Mar 10, 2017 at 12:40 AM VikS <[email protected]> wrote:

> Thank you, I never scripted using Groovy and tried this *String
> fileContents = new File("C:/temp/applicationlist.txt").text* which did
> not work...
>
>
> On Friday, March 10, 2017 at 11:04:10 AM UTC+8, Ioannis Moutsatsos wrote:
>
> Take a look at the Active Choices plugin
> <https://wiki.jenkins-ci.org/display/JENKINS/Active+Choices+Plugin>
> instead. A simple Groovy script can be used to read the text file and
> return a list of the choices.
>
> On Thursday, March 9, 2017 at 6:31:36 AM UTC-5, VikS wrote:
>
> -3 down vote favorite
> <http://stackoverflow.com/questions/42686999/using-extended-choice-parameter-in-jenkins#>
>
> I would like to create an Extended Choice Parameter option and for the
> choices to be listed from a text file? Would it be possible and if yes, how
> can i achieve that?
>
> [image: Image]
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/tzvYEp76IVg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/ae1008fe-2229-4c04-93bb-634ad9943011%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/ae1008fe-2229-4c04-93bb-634ad9943011%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAOwNbFu8muzQcCb3o_J-W9NFzxqDm8Lo6FYKYRAm53sLpq9uhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to