Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29431

file list values are returned as a single string

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • active-choices-plugin
    • 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

            kinow Bruno P. Kinoshita
            nikhilp2111 nikhil potti
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: