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

In CascadeChoiceParameter, loading status happen. So, I cannot select items in parameter at all.

      Hello! I updated jenkins lts to 2.4402. and Active Choices Plug-in 2.8.3. 

       

      But, at Active Choices Plug-in 2.8.2, 
      CascadeChoiceParameter loading error happen.
       
      I made build parameter right that.
       
       

      choice(
          name: 'Test1',
          choices: ["A", "B"].join("\n"),
          description: 'for test1'
      ),
      choice(
          name: 'Test2',
          choices: ["C", "D"],
          description: 'for test2'
      ),
      [
          $class: 'CascadeChoiceParameter',
          name: 'LogOptions",
          choiceType: "PT_SINGLE_SELECT",
          referenceParameters: "Test1,Test2",
          script: [
              $class: 'GroovyScript",
              script: [
                  classpath: [],
                  sandbox: true,
                  script: """
      if (Test1.equals('A') && Test2.equals('C')) {
          return [
              'First:selected',
              'second'
          ]
      } else {
          return [
              'First:selected'
          ]
      }""".stripIndent()
                 ]
              ],
              description: 'Test'
          ]

       And I access at build parameter page, I cannot select parameter value of "LogOptions" parameter. only loading status showing. This parameter type is "CascadeChoiceParameter. I think CascadeChoiceParameter have bug. have you try to check this bug please?

       

      (at Active Choices Plug-in 2.8.3, same problem happen.
       

          [JENKINS-72949] In CascadeChoiceParameter, loading status happen. So, I cannot select items in parameter at all.

          Pinned comments

          Pinned by Gooksung

          Gooksung added a comment - - edited

          kinow Hello Bruno! 

          At first, Thanks for your comment and check. 

          And I would like to ask a question to you carefully. 

           

          I did this build by the scripted pipeline method, not free style. So I used groovy script to build this job because this job's build method is scripted pipeline. 

          Anyway, I want to ask you a question about this issue once more. 

           

          I updated Jenkins lts version from 2.426.3 to 2.440.3. And updated Active Choices Plugin version from 2.8.1 to 2.8.2 or 2.8.3. 

          But, when I tried to update from 2.8.1 to 2.8.2, this issue happened. So, I tried to fix this problem I’m all day. 

          And the next thing is that I tested. 

           

          When I write new script, as you tested, it works normally. 

          But, if script is written at Active Choices Plugin version 2.8.1, this problem happened. By the way, when I renamed build Parameter name which have problems(this issue), it works. 
          Also, when I return to existing name to build parameter it occurs problems(this issue) again as previously. 

          Can you change build parameter name to LogOptions or KeepVersion?

           

          I think this issue's pattern is so weird. So I want to ask a question to you. 

           

          When version to be changed, can version confilct be happend? I think this case is version conflict case. 

          Gooksung added a comment - - edited kinow Hello Bruno!  At first, Thanks for your comment and check.  And I would like to ask a question to you carefully.    I did this build by the scripted pipeline method, not free style. So I used groovy script to build this job because this job's build method is scripted pipeline.  Anyway, I want to ask you a question about this issue once more.    I updated Jenkins lts version from 2.426.3 to 2.440.3. And updated Active Choices Plugin version from 2.8.1 to 2.8.2 or 2.8.3.  But, when I tried to update from 2.8.1 to 2.8.2, this issue happened. So, I tried to fix this problem I’m all day.  And the next thing is that I tested.    When I write new script, as you tested, it works normally.  But, if script is written at Active Choices Plugin version 2.8.1, this problem happened. By the way, when I renamed build Parameter name which have problems(this issue), it works.  Also, when I return to existing name to build parameter it occurs problems(this issue) again as previously.  Can you change build parameter name to LogOptions or KeepVersion?   I think this issue's pattern is so weird. So I want to ask a question to you.    When version to be changed, can version confilct be happend? I think this case is version conflict case. 

          Pinned by Gooksung

          Gooksung added a comment - - edited

          kinow Hello! Bruno! I remade script which makes this issue. when i use this script to build, this issue happened. 

           

          (if, error not happen, refresh page several times. then error happen.)

           

          Can u check this case one more? Thanks for your check!! 
           

          import java.util.concurrent.TimeUnit 
          import org.jenkinsci.plugins.pipeline.modeldefinition.Utils 
          import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException 
          
          def serverJson = [ 
              "aaa": "https://example.com", 
              "bbb": "https://example2.com" 
          ] 
          def saverLi = [] 
          serverJson.each{k, v -> saverLi.add(k)} 
          
          properties([ 
              disableConcurrentBuilds(), 
              buildDiscarder(logRotator(daysToKeepStr: "90", numToKeepStr: "30")), 
              parameters([ 
                  choice( 
                      name: 'AutoMobile', 
                      choices: ["Yes", "No"].join("\n"), 
                      description: '' 
                  ), 
                  choice( 
                      name: 'BibiOptions', 
                      choices: ["Rily", "Bug"].join("\n"), 
                      description: '' 
                  ), 
                  choice( 
                      name: 'SaverLi', 
                      choices: saverLi.join("\n"),
                      description: '' 
                  ),
                  [ 
                      $class: 'CascadeChoiceParameter', 
                      name: 'loginOps', 
                      choiceType: 'PT_SINGLE_SELECT', 
                      referencedParameters: 'BibiOptions,SaverLi', 
                      script: [ 
                          $class: 'GroovyScript', 
                          script: [ classpath: [], 
                          sandbox: true, 
                          script: """ 
          if (BibiOptions.equals('Rily') && SaverLi.equals('prod')) {
              return [ 
                  'aaa:selected', 'bbb' 
              ] 
          } else { 
              return [ 
                  'aaa:selected' 
              ]
          } """.stripIndent() 
                          ] 
                      ], 
                      description: '' 
                  ], 
                  [ 
                      $class: 'CascadeChoiceParameter', 
                      name: 'EscapeEarth', 
                      choiceType: 'PT_RADIO', 
                      referencedParameters: 'BibiOptions', 
                      script: [ 
                          $class: 'GroovyScript', 
                          script: [ 
                              classpath: [], 
                              sandbox: true, 
                              script: """ 
          if (BibiOptions.equals('Bug')) { 
              return []; 
          } else { 
              return [ 
                  'True:selected', 
                  'False' 
              ] 
          } 
                              """.stripIndent() 
                          ] 
                       ], 
                       description: '' 
                      ], 
                      [ 
                          $class: 'DynamicReferenceParameter', 
                          name: 'GreenNote', 
                          choiceType: 'ET_FORMATTED_HTML', 
                          referencedParameters: 'BibiOptions,SaverLi,loginOps,EscapeEarth', 
                          script: [ 
                              $class: 'GroovyScript', 
                              script: [ 
                                  classpath: [], 
                                  sandbox: true, 
                                  script: """ 
          String html_str = '<textarea style="width: 500px;height:300px;" name="value">'; 
          html_str += BibiOptions + ' Count\\n';ac 
          html_str += Example + ' 예시, ' + loginOps + ', ' + SaverLi + ', EscapeEarth:' + EscapeEarth; 
          html_str += '</textarea>'; 
          
          return html_str; 
                                  """.stripIndent() 
                              ] 
                          ], 
                          description: '' 
                      ] 
                  ]) 
          ]) 
          
          node { }

           

          Gooksung added a comment - - edited kinow Hello! Bruno! I remade script which makes this issue. when i use this script to build, this issue happened.    (if, error not happen, refresh page several times. then error happen.)   Can u check this case one more? Thanks for your check!!    import java.util.concurrent.TimeUnit import org.jenkinsci.plugins.pipeline.modeldefinition.Utils import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException def serverJson = [ "aaa" : "https: //example.com" , "bbb" : "https: //example2.com" ] def saverLi = [] serverJson.each{k, v -> saverLi.add(k)} properties([ disableConcurrentBuilds(), buildDiscarder(logRotator(daysToKeepStr: "90" , numToKeepStr: "30" )), parameters([ choice( name: 'AutoMobile' , choices: [ "Yes" , "No" ].join( "\n" ), description: '' ), choice( name: 'BibiOptions' , choices: [ "Rily" , "Bug" ].join( "\n" ), description: '' ), choice( name: 'SaverLi' , choices: saverLi.join( "\n" ), description: '' ), [ $class: 'CascadeChoiceParameter' , name: 'loginOps' , choiceType: 'PT_SINGLE_SELECT' , referencedParameters: 'BibiOptions,SaverLi' , script: [ $class: 'GroovyScript' , script: [ classpath: [], sandbox: true , script: """ if (BibiOptions.equals( 'Rily' ) && SaverLi.equals( 'prod' )) { return [ 'aaa:selected' , 'bbb' ] } else { return [ 'aaa:selected' ] } """.stripIndent() ] ], description: '' ], [ $class: 'CascadeChoiceParameter' , name: 'EscapeEarth' , choiceType: 'PT_RADIO' , referencedParameters: 'BibiOptions' , script: [ $class: 'GroovyScript' , script: [ classpath: [], sandbox: true , script: """ if (BibiOptions.equals( 'Bug' )) { return []; } else { return [ 'True:selected' , 'False' ] } """.stripIndent() ] ], description: '' ], [ $class: 'DynamicReferenceParameter' , name: 'GreenNote' , choiceType: 'ET_FORMATTED_HTML' , referencedParameters: 'BibiOptions,SaverLi,loginOps,EscapeEarth' , script: [ $class: 'GroovyScript' , script: [ classpath: [], sandbox: true , script: """ String html_str = '<textarea style= "width: 500px;height:300px;" name= "value" >' ; html_str += BibiOptions + ' Count\\n' ;ac html_str += Example + ' 예시, ' + loginOps + ', ' + SaverLi + ', EscapeEarth:' + EscapeEarth; html_str += '</textarea>' ; return html_str; """.stripIndent() ] ], description: '' ] ]) ]) node { }  

          All comments

          안녕하세요 noah_kook 

          >I made build parameter right that.

          I re-created your example with a FreeStyle build - it's easier for me to test, even easier if you can provide a config.xml to be imported in future issue reports – but what you provided was great.

          See attached screenshot screncast.gif.

          Do you have any browser JS console errors or warnings?

          If you enable logging for org.biouno in Jenkins settings, and try again, do you have any extra log?

          If you try a FreeStyle build and manually add the parameters, does it work?

          Answering the questions above should clarify what's happening in your environment.

          Cheers,

          Bruno

          Bruno P. Kinoshita added a comment - 안녕하세요 noah_kook   >I made build parameter right that. I re-created your example with a FreeStyle build - it's easier for me to test, even easier if you can provide a config.xml to be imported in future issue reports – but what you provided was great. See attached screenshot screncast.gif. Do you have any browser JS console errors or warnings? If you enable logging for org.biouno in Jenkins settings, and try again, do you have any extra log? If you try a FreeStyle build and manually add the parameters, does it work? Answering the questions above should clarify what's happening in your environment. Cheers, Bruno

          Pinned by Gooksung

          Gooksung added a comment - - edited

          kinow Hello Bruno! 

          At first, Thanks for your comment and check. 

          And I would like to ask a question to you carefully. 

           

          I did this build by the scripted pipeline method, not free style. So I used groovy script to build this job because this job's build method is scripted pipeline. 

          Anyway, I want to ask you a question about this issue once more. 

           

          I updated Jenkins lts version from 2.426.3 to 2.440.3. And updated Active Choices Plugin version from 2.8.1 to 2.8.2 or 2.8.3. 

          But, when I tried to update from 2.8.1 to 2.8.2, this issue happened. So, I tried to fix this problem I’m all day. 

          And the next thing is that I tested. 

           

          When I write new script, as you tested, it works normally. 

          But, if script is written at Active Choices Plugin version 2.8.1, this problem happened. By the way, when I renamed build Parameter name which have problems(this issue), it works. 
          Also, when I return to existing name to build parameter it occurs problems(this issue) again as previously. 

          Can you change build parameter name to LogOptions or KeepVersion?

           

          I think this issue's pattern is so weird. So I want to ask a question to you. 

           

          When version to be changed, can version confilct be happend? I think this case is version conflict case. 

          Gooksung added a comment - - edited kinow Hello Bruno!  At first, Thanks for your comment and check.  And I would like to ask a question to you carefully.    I did this build by the scripted pipeline method, not free style. So I used groovy script to build this job because this job's build method is scripted pipeline.  Anyway, I want to ask you a question about this issue once more.    I updated Jenkins lts version from 2.426.3 to 2.440.3. And updated Active Choices Plugin version from 2.8.1 to 2.8.2 or 2.8.3.  But, when I tried to update from 2.8.1 to 2.8.2, this issue happened. So, I tried to fix this problem I’m all day.  And the next thing is that I tested.    When I write new script, as you tested, it works normally.  But, if script is written at Active Choices Plugin version 2.8.1, this problem happened. By the way, when I renamed build Parameter name which have problems(this issue), it works.  Also, when I return to existing name to build parameter it occurs problems(this issue) again as previously.  Can you change build parameter name to LogOptions or KeepVersion?   I think this issue's pattern is so weird. So I want to ask a question to you.    When version to be changed, can version confilct be happend? I think this case is version conflict case. 

          Pinned by Gooksung

          Gooksung added a comment - - edited

          kinow Hello! Bruno! I remade script which makes this issue. when i use this script to build, this issue happened. 

           

          (if, error not happen, refresh page several times. then error happen.)

           

          Can u check this case one more? Thanks for your check!! 
           

          import java.util.concurrent.TimeUnit 
          import org.jenkinsci.plugins.pipeline.modeldefinition.Utils 
          import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException 
          
          def serverJson = [ 
              "aaa": "https://example.com", 
              "bbb": "https://example2.com" 
          ] 
          def saverLi = [] 
          serverJson.each{k, v -> saverLi.add(k)} 
          
          properties([ 
              disableConcurrentBuilds(), 
              buildDiscarder(logRotator(daysToKeepStr: "90", numToKeepStr: "30")), 
              parameters([ 
                  choice( 
                      name: 'AutoMobile', 
                      choices: ["Yes", "No"].join("\n"), 
                      description: '' 
                  ), 
                  choice( 
                      name: 'BibiOptions', 
                      choices: ["Rily", "Bug"].join("\n"), 
                      description: '' 
                  ), 
                  choice( 
                      name: 'SaverLi', 
                      choices: saverLi.join("\n"),
                      description: '' 
                  ),
                  [ 
                      $class: 'CascadeChoiceParameter', 
                      name: 'loginOps', 
                      choiceType: 'PT_SINGLE_SELECT', 
                      referencedParameters: 'BibiOptions,SaverLi', 
                      script: [ 
                          $class: 'GroovyScript', 
                          script: [ classpath: [], 
                          sandbox: true, 
                          script: """ 
          if (BibiOptions.equals('Rily') && SaverLi.equals('prod')) {
              return [ 
                  'aaa:selected', 'bbb' 
              ] 
          } else { 
              return [ 
                  'aaa:selected' 
              ]
          } """.stripIndent() 
                          ] 
                      ], 
                      description: '' 
                  ], 
                  [ 
                      $class: 'CascadeChoiceParameter', 
                      name: 'EscapeEarth', 
                      choiceType: 'PT_RADIO', 
                      referencedParameters: 'BibiOptions', 
                      script: [ 
                          $class: 'GroovyScript', 
                          script: [ 
                              classpath: [], 
                              sandbox: true, 
                              script: """ 
          if (BibiOptions.equals('Bug')) { 
              return []; 
          } else { 
              return [ 
                  'True:selected', 
                  'False' 
              ] 
          } 
                              """.stripIndent() 
                          ] 
                       ], 
                       description: '' 
                      ], 
                      [ 
                          $class: 'DynamicReferenceParameter', 
                          name: 'GreenNote', 
                          choiceType: 'ET_FORMATTED_HTML', 
                          referencedParameters: 'BibiOptions,SaverLi,loginOps,EscapeEarth', 
                          script: [ 
                              $class: 'GroovyScript', 
                              script: [ 
                                  classpath: [], 
                                  sandbox: true, 
                                  script: """ 
          String html_str = '<textarea style="width: 500px;height:300px;" name="value">'; 
          html_str += BibiOptions + ' Count\\n';ac 
          html_str += Example + ' 예시, ' + loginOps + ', ' + SaverLi + ', EscapeEarth:' + EscapeEarth; 
          html_str += '</textarea>'; 
          
          return html_str; 
                                  """.stripIndent() 
                              ] 
                          ], 
                          description: '' 
                      ] 
                  ]) 
          ]) 
          
          node { }

           

          Gooksung added a comment - - edited kinow Hello! Bruno! I remade script which makes this issue. when i use this script to build, this issue happened.    (if, error not happen, refresh page several times. then error happen.)   Can u check this case one more? Thanks for your check!!    import java.util.concurrent.TimeUnit import org.jenkinsci.plugins.pipeline.modeldefinition.Utils import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException def serverJson = [ "aaa" : "https: //example.com" , "bbb" : "https: //example2.com" ] def saverLi = [] serverJson.each{k, v -> saverLi.add(k)} properties([ disableConcurrentBuilds(), buildDiscarder(logRotator(daysToKeepStr: "90" , numToKeepStr: "30" )), parameters([ choice( name: 'AutoMobile' , choices: [ "Yes" , "No" ].join( "\n" ), description: '' ), choice( name: 'BibiOptions' , choices: [ "Rily" , "Bug" ].join( "\n" ), description: '' ), choice( name: 'SaverLi' , choices: saverLi.join( "\n" ), description: '' ), [ $class: 'CascadeChoiceParameter' , name: 'loginOps' , choiceType: 'PT_SINGLE_SELECT' , referencedParameters: 'BibiOptions,SaverLi' , script: [ $class: 'GroovyScript' , script: [ classpath: [], sandbox: true , script: """ if (BibiOptions.equals( 'Rily' ) && SaverLi.equals( 'prod' )) { return [ 'aaa:selected' , 'bbb' ] } else { return [ 'aaa:selected' ] } """.stripIndent() ] ], description: '' ], [ $class: 'CascadeChoiceParameter' , name: 'EscapeEarth' , choiceType: 'PT_RADIO' , referencedParameters: 'BibiOptions' , script: [ $class: 'GroovyScript' , script: [ classpath: [], sandbox: true , script: """ if (BibiOptions.equals( 'Bug' )) { return []; } else { return [ 'True:selected' , 'False' ] } """.stripIndent() ] ], description: '' ], [ $class: 'DynamicReferenceParameter' , name: 'GreenNote' , choiceType: 'ET_FORMATTED_HTML' , referencedParameters: 'BibiOptions,SaverLi,loginOps,EscapeEarth' , script: [ $class: 'GroovyScript' , script: [ classpath: [], sandbox: true , script: """ String html_str = '<textarea style= "width: 500px;height:300px;" name= "value" >' ; html_str += BibiOptions + ' Count\\n' ;ac html_str += Example + ' 예시, ' + loginOps + ', ' + SaverLi + ', EscapeEarth:' + EscapeEarth; html_str += '</textarea>' ; return html_str; """.stripIndent() ] ], description: '' ] ]) ]) node { }  

            kinow Bruno P. Kinoshita
            noah_kook Gooksung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: