-
Bug
-
Resolution: Fixed
-
Minor
-
OS: Redhat 64bit 5.x
Jenkins 1.610
uno choice plugin 0.22
Firefox
java 1.7
Requirement:
- place the choice contents(a1,a2,a3,a4) in a file at unix, with help of Groovy script get the contents and return the list
What works:
------------
def list1 = ["a1", "a2", "a3" ]
return list1
-----------------
What doesn't work:
— keeping the choice contents in a unix file and pulling the list using groovy script and return the values.
vi groovey1
"t1",
"t2",
"t3",
---------
Groovy script:
----------------
def File file = new File("/infapoc2/jenkins/Scripts/reports/script_report/groovey1")
def fileContent = file.getText()
return [fileContent]
------------
Output: o "t1", "t2", "t3"
but expected "
o t1
o t2
o t3
remember that you must return a list or a map for having multiple options (one per list or map element)
The file.getText() method returns a String and this is what you get.
To get the expected output you should try something like
Please, let us know how this works for you.