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

Active Choices Reactive Parameter Groovy script returning String instead of List

    Details

    • Similar Issues:

      Description

      I have an Active Choices parameter defined: It is an Active Choices Reactive parameter, where I am simply returning a list of character strings via the Groovy script (i.e: return ['example1','example2']) that will be used to create some check boxes. I notice from the documentation that the way I have formatted this should return a List. I have also verified that this does return a List in a Groovy web console.

      Now, the problem occurs when I attempt to index the List later on in my Jenkinsfile. If my List contained ["example1","example2"], then list[0] would return "e" instead of "example1". It looked like my List was actually a String instead. I debugged the parameter and found that it actually was a String type.

      I am wondering why my parameter is being returned as a String instead of a List, as it appears that the way I have set it up should return a List, which I should then be able to index.

       

        Attachments

          Activity

          bhand14 Brett Hand created issue -
          bhand14 Brett Hand made changes -
          Field Original Value New Value
          Description I have an Active Choices parameters defined: It is an Active Choices Reactive parameter, where I am simply returning a list of character strings via the Groovy script (i.e: return ['example1','example2']) that will be used to create some check boxes. I notice from the documentation that the way I have formatted this should return an ArrayList. I have also verified that this does return an ArrayList in a Groovy web console.

          Now, the problem occurs when I attempt to index the list later on in my Jenkinsfile. If my list contained ["example1","example2"], then list[0] would return "e" instead of "example1". It looked like my list was actually a String instead. I debugged the parameter and found that it actually was a String type.

          I am wondering why my parameter is being returned as a String instead of a list, as it appears that the way I have set it up should return a list, which I should then be able to index.

           
          I have an Active Choices parameter defined: It is an Active Choices Reactive parameter, where I am simply returning a list of character strings via the Groovy script (i.e: return ['example1','example2']) that will be used to create some check boxes. I notice from the documentation that the way I have formatted this should return an ArrayList. I have also verified that this does return an ArrayList in a Groovy web console.

          Now, the problem occurs when I attempt to index the list later on in my Jenkinsfile. If my list contained ["example1","example2"], then list[0] would return "e" instead of "example1". It looked like my list was actually a String instead. I debugged the parameter and found that it actually was a String type.

          I am wondering why my parameter is being returned as a String instead of a list, as it appears that the way I have set it up should return a list, which I should then be able to index.

           
          bhand14 Brett Hand made changes -
          Description I have an Active Choices parameter defined: It is an Active Choices Reactive parameter, where I am simply returning a list of character strings via the Groovy script (i.e: return ['example1','example2']) that will be used to create some check boxes. I notice from the documentation that the way I have formatted this should return an ArrayList. I have also verified that this does return an ArrayList in a Groovy web console.

          Now, the problem occurs when I attempt to index the list later on in my Jenkinsfile. If my list contained ["example1","example2"], then list[0] would return "e" instead of "example1". It looked like my list was actually a String instead. I debugged the parameter and found that it actually was a String type.

          I am wondering why my parameter is being returned as a String instead of a list, as it appears that the way I have set it up should return a list, which I should then be able to index.

           
          I have an Active Choices parameter defined: It is an Active Choices Reactive parameter, where I am simply returning a list of character strings via the Groovy script (i.e: return ['example1','example2']) that will be used to create some check boxes. I notice from the documentation that the way I have formatted this should return an List. I have also verified that this does return an List in a Groovy web console.

          Now, the problem occurs when I attempt to index the list later on in my Jenkinsfile. If my list contained ["example1","example2"], then list[0] would return "e" instead of "example1". It looked like my list was actually a String instead. I debugged the parameter and found that it actually was a String type.

          I am wondering why my parameter is being returned as a String instead of a list, as it appears that the way I have set it up should return a list, which I should then be able to index.

           
          bhand14 Brett Hand made changes -
          Description I have an Active Choices parameter defined: It is an Active Choices Reactive parameter, where I am simply returning a list of character strings via the Groovy script (i.e: return ['example1','example2']) that will be used to create some check boxes. I notice from the documentation that the way I have formatted this should return an List. I have also verified that this does return an List in a Groovy web console.

          Now, the problem occurs when I attempt to index the list later on in my Jenkinsfile. If my list contained ["example1","example2"], then list[0] would return "e" instead of "example1". It looked like my list was actually a String instead. I debugged the parameter and found that it actually was a String type.

          I am wondering why my parameter is being returned as a String instead of a list, as it appears that the way I have set it up should return a list, which I should then be able to index.

           
          I have an Active Choices parameter defined: It is an Active Choices Reactive parameter, where I am simply returning a list of character strings via the Groovy script (i.e: return ['example1','example2']) that will be used to create some check boxes. I notice from the documentation that the way I have formatted this should return an List. I have also verified that this does return an List in a Groovy web console.

          Now, the problem occurs when I attempt to index the List later on in my Jenkinsfile. If my List contained ["example1","example2"], then list[0] would return "e" instead of "example1". It looked like my List was actually a String instead. I debugged the parameter and found that it actually was a String type.

          I am wondering why my parameter is being returned as a String instead of a List, as it appears that the way I have set it up should return a List, which I should then be able to index.

           
          bhand14 Brett Hand made changes -
          Description I have an Active Choices parameter defined: It is an Active Choices Reactive parameter, where I am simply returning a list of character strings via the Groovy script (i.e: return ['example1','example2']) that will be used to create some check boxes. I notice from the documentation that the way I have formatted this should return an List. I have also verified that this does return an List in a Groovy web console.

          Now, the problem occurs when I attempt to index the List later on in my Jenkinsfile. If my List contained ["example1","example2"], then list[0] would return "e" instead of "example1". It looked like my List was actually a String instead. I debugged the parameter and found that it actually was a String type.

          I am wondering why my parameter is being returned as a String instead of a List, as it appears that the way I have set it up should return a List, which I should then be able to index.

           
          I have an Active Choices parameter defined: It is an Active Choices Reactive parameter, where I am simply returning a list of character strings via the Groovy script (i.e: return ['example1','example2']) that will be used to create some check boxes. I notice from the documentation that the way I have formatted this should return a List. I have also verified that this does return a List in a Groovy web console.

          Now, the problem occurs when I attempt to index the List later on in my Jenkinsfile. If my List contained ["example1","example2"], then list[0] would return "e" instead of "example1". It looked like my List was actually a String instead. I debugged the parameter and found that it actually was a String type.

          I am wondering why my parameter is being returned as a String instead of a List, as it appears that the way I have set it up should return a List, which I should then be able to index.

           

            People

            • Assignee:
              kinow Bruno P. Kinoshita
              Reporter:
              bhand14 Brett Hand
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: