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

Active Choices Reactive Reference Parameter triggering the groovy script twice

    Details

    • Similar Issues:

      Description

      I am trying to fetch a list of branches from git in the active choice reactive reference parameter.I am using the run groovy script option.

      But the script is ran twice when I check the tomcat logs.

      Because of which the drop down is rendered twice.

      Please find the below script

      def html=
       '''
       <div style="padding-top:-2em;margin-left:1em;">
       <select id="module" style="height:2.2em;width:10.8em" name="value">
       <option value="">Select...</option>
       '''
       def cmd = ["/bin/bash", "-c","sudo sh /home/centos/JenkinScripts/dynamicChoices/getBranchesFromGit.sh https://KGJenkins@bitbucket.org/vtakru/escloudadmin.git"]
       def sout = new StringBuffer()
       def serr = new StringBuffer()
       // Run the command
       println "running "+cmd
       def proc = cmd.execute()
       proc.consumeProcessOutput ( sout, serr )
       proc.waitFor() 
       def options=""
       sout.tokenize().each{ branch->
       if(branch.contains("refs/heads/")){
       branch=branch.minus("refs/heads/")
       println "Branch "+branch
       options+="<option value=$branch>$branch</option>"
       }
       }
       html+=options
       return html

       

      Please help me with this issue

       

        Attachments

          Activity

          akash0092 Akash Muduli created issue -
          akash0092 Akash Muduli made changes -
          Field Original Value New Value
          Description I am trying to fetch a list of branches in the active choice reactive reference parameter.I am using the run groovy script option.

          But the script is ran twice when I check the tomcat logs.

          Because of which the dropdown is rendered twice.

          Please find the below script

          html=
          '''
          <div style="padding-top:-2em;margin-left:1em;">
          <select id="module" style="height:2.2em;width:10.8em" name="value">
          <option value="">Select...</option>
          '''
          def cmd = ["/bin/bash", "-c","sudo sh /home/centos/JenkinScripts/dynamicChoices/getBranchesFromGit.sh https://KGJenkins@bitbucket.org/vtakru/escloudadmin.git"]
           def sout = new StringBuffer()
           def serr = new StringBuffer()
           // Run the command
           println "running "+cmd
           def proc = cmd.execute()
           proc.consumeProcessOutput ( sout, serr )
           proc.waitFor()
          def options=""
          sout.tokenize().each\{ branch->
          if(branch.contains("refs/heads/"))\{
          branch=branch.minus("refs/heads/")
           println "Branch "+branch
          options+="<option value=$branch>$branch</option>"
          }
          }
          html+=options
          return html

           

          Please help me with this issue

           
          I am trying to fetch a list of branches from git in the active choice reactive reference parameter.I am using the run *groovy script* option.

          But the script is ran twice when I check the tomcat logs.

          Because of which the drop down is rendered twice.

          Please find the below script

          html=
           '''
           <div style="padding-top:-2em;margin-left:1em;">
           <select id="module" style="height:2.2em;width:10.8em" name="value">
           <option value="">Select...</option>
           '''
           def cmd = ["/bin/bash", "-c","sudo sh /home/centos/JenkinScripts/dynamicChoices/getBranchesFromGit.sh https://KGJenkins@bitbucket.org/vtakru/escloudadmin.git"]
           def sout = new StringBuffer()
           def serr = new StringBuffer()
           // Run the command
           println "running "+cmd
           def proc = cmd.execute()
           proc.consumeProcessOutput ( sout, serr )
           proc.waitFor()
           def options=""
           sout.tokenize().each\{ branch->
           if(branch.contains("refs/heads/"))\{
           branch=branch.minus("refs/heads/")
           println "Branch "+branch
           options+="<option value=$branch>$branch</option>"
           }
           }
           html+=options
           return html

           

          Please help me with this issue

           
          gautamabhishek46 Abhishek Gautam made changes -
          Description I am trying to fetch a list of branches from git in the active choice reactive reference parameter.I am using the run *groovy script* option.

          But the script is ran twice when I check the tomcat logs.

          Because of which the drop down is rendered twice.

          Please find the below script

          html=
           '''
           <div style="padding-top:-2em;margin-left:1em;">
           <select id="module" style="height:2.2em;width:10.8em" name="value">
           <option value="">Select...</option>
           '''
           def cmd = ["/bin/bash", "-c","sudo sh /home/centos/JenkinScripts/dynamicChoices/getBranchesFromGit.sh https://KGJenkins@bitbucket.org/vtakru/escloudadmin.git"]
           def sout = new StringBuffer()
           def serr = new StringBuffer()
           // Run the command
           println "running "+cmd
           def proc = cmd.execute()
           proc.consumeProcessOutput ( sout, serr )
           proc.waitFor()
           def options=""
           sout.tokenize().each\{ branch->
           if(branch.contains("refs/heads/"))\{
           branch=branch.minus("refs/heads/")
           println "Branch "+branch
           options+="<option value=$branch>$branch</option>"
           }
           }
           html+=options
           return html

           

          Please help me with this issue

           
          I am trying to fetch a list of branches from git in the active choice reactive reference parameter.I am using the run *groovy script* option.

          But the script is ran twice when I check the tomcat logs.

          Because of which the drop down is rendered twice.

          Please find the below script

          html=
          '''
          <div style="padding-top:-2em;margin-left:1em;">
          <select id="module" style="height:2.2em;width:10.8em" name="value">
          <option value="">Select...</option>
          '''
          def cmd = ["/bin/bash", "-c","sudo sh /home/centos/JenkinScripts/dynamicChoices/getBranchesFromGit.sh https://KGJenkins@bitbucket.org/vtakru/escloudadmin.git"]
          def sout = new StringBuffer()
          def serr = new StringBuffer()
          // Run the command
          println "running "+cmd
          def proc = cmd.execute()
          proc.consumeProcessOutput ( sout, serr )
          proc.waitFor()
          def options=""
          sout.tokenize().each\{ branch->
          if(branch.contains("refs/heads/"))\{
          branch=branch.minus("refs/heads/")
          println "Branch "+branch
          options+="<option value=$branch>$branch</option>"
          }
          }
          html+=options
          return html

           

          Please help me with this issue

           
          kinow Bruno P. Kinoshita made changes -
          Description I am trying to fetch a list of branches from git in the active choice reactive reference parameter.I am using the run *groovy script* option.

          But the script is ran twice when I check the tomcat logs.

          Because of which the drop down is rendered twice.

          Please find the below script

          html=
          '''
          <div style="padding-top:-2em;margin-left:1em;">
          <select id="module" style="height:2.2em;width:10.8em" name="value">
          <option value="">Select...</option>
          '''
          def cmd = ["/bin/bash", "-c","sudo sh /home/centos/JenkinScripts/dynamicChoices/getBranchesFromGit.sh https://KGJenkins@bitbucket.org/vtakru/escloudadmin.git"]
          def sout = new StringBuffer()
          def serr = new StringBuffer()
          // Run the command
          println "running "+cmd
          def proc = cmd.execute()
          proc.consumeProcessOutput ( sout, serr )
          proc.waitFor()
          def options=""
          sout.tokenize().each\{ branch->
          if(branch.contains("refs/heads/"))\{
          branch=branch.minus("refs/heads/")
          println "Branch "+branch
          options+="<option value=$branch>$branch</option>"
          }
          }
          html+=options
          return html

           

          Please help me with this issue

           
          I am trying to fetch a list of branches from git in the active choice reactive reference parameter.I am using the run *groovy script* option.

          But the script is ran twice when I check the tomcat logs.

          Because of which the drop down is rendered twice.

          Please find the below script

          html=
          {code:java}
           <div style="padding-top:-2em;margin-left:1em;">
           <select id="module" style="height:2.2em;width:10.8em" name="value">
           <option value="">Select...</option>{code}
           
          {code:java}
           def cmd = ["/bin/bash", "-c","sudo sh /home/centos/JenkinScripts/dynamicChoices/getBranchesFromGit.sh https://KGJenkins@bitbucket.org/vtakru/escloudadmin.git"]
           def sout = new StringBuffer()
           def serr = new StringBuffer()
           // Run the command
           println "running "+cmd
           def proc = cmd.execute()
           proc.consumeProcessOutput ( sout, serr )
           proc.waitFor()
           def options=""
           sout.tokenize().each{ branch->
           if(branch.contains("refs/heads/")){
           branch=branch.minus("refs/heads/")
           println "Branch "+branch
           options+="<option value=$branch>$branch</option>"
           }
           }
           html+=options
           return html {code}
           

          Please help me with this issue

           
          kinow Bruno P. Kinoshita made changes -
          Description I am trying to fetch a list of branches from git in the active choice reactive reference parameter.I am using the run *groovy script* option.

          But the script is ran twice when I check the tomcat logs.

          Because of which the drop down is rendered twice.

          Please find the below script

          html=
          {code:java}
           <div style="padding-top:-2em;margin-left:1em;">
           <select id="module" style="height:2.2em;width:10.8em" name="value">
           <option value="">Select...</option>{code}
           
          {code:java}
           def cmd = ["/bin/bash", "-c","sudo sh /home/centos/JenkinScripts/dynamicChoices/getBranchesFromGit.sh https://KGJenkins@bitbucket.org/vtakru/escloudadmin.git"]
           def sout = new StringBuffer()
           def serr = new StringBuffer()
           // Run the command
           println "running "+cmd
           def proc = cmd.execute()
           proc.consumeProcessOutput ( sout, serr )
           proc.waitFor()
           def options=""
           sout.tokenize().each{ branch->
           if(branch.contains("refs/heads/")){
           branch=branch.minus("refs/heads/")
           println "Branch "+branch
           options+="<option value=$branch>$branch</option>"
           }
           }
           html+=options
           return html {code}
           

          Please help me with this issue

           
          I am trying to fetch a list of branches from git in the active choice reactive reference parameter.I am using the run *groovy script* option.

          But the script is ran twice when I check the tomcat logs.

          Because of which the drop down is rendered twice.

          Please find the below script
          {code:java}
          def html=
           '''
           <div style="padding-top:-2em;margin-left:1em;">
           <select id="module" style="height:2.2em;width:10.8em" name="value">
           <option value="">Select...</option>
           '''
           def cmd = ["/bin/bash", "-c","sudo sh /home/centos/JenkinScripts/dynamicChoices/getBranchesFromGit.sh https://KGJenkins@bitbucket.org/vtakru/escloudadmin.git"]
           def sout = new StringBuffer()
           def serr = new StringBuffer()
           // Run the command
           println "running "+cmd
           def proc = cmd.execute()
           proc.consumeProcessOutput ( sout, serr )
           proc.waitFor()
           def options=""
           sout.tokenize().each{ branch->
           if(branch.contains("refs/heads/")){
           branch=branch.minus("refs/heads/")
           println "Branch "+branch
           options+="<option value=$branch>$branch</option>"
           }
           }
           html+=options
           return html{code}
           

          Please help me with this issue

           
          kinow Bruno P. Kinoshita made changes -
          Description I am trying to fetch a list of branches from git in the active choice reactive reference parameter.I am using the run *groovy script* option.

          But the script is ran twice when I check the tomcat logs.

          Because of which the drop down is rendered twice.

          Please find the below script
          {code:java}
          def html=
           '''
           <div style="padding-top:-2em;margin-left:1em;">
           <select id="module" style="height:2.2em;width:10.8em" name="value">
           <option value="">Select...</option>
           '''
           def cmd = ["/bin/bash", "-c","sudo sh /home/centos/JenkinScripts/dynamicChoices/getBranchesFromGit.sh https://KGJenkins@bitbucket.org/vtakru/escloudadmin.git"]
           def sout = new StringBuffer()
           def serr = new StringBuffer()
           // Run the command
           println "running "+cmd
           def proc = cmd.execute()
           proc.consumeProcessOutput ( sout, serr )
           proc.waitFor()
           def options=""
           sout.tokenize().each{ branch->
           if(branch.contains("refs/heads/")){
           branch=branch.minus("refs/heads/")
           println "Branch "+branch
           options+="<option value=$branch>$branch</option>"
           }
           }
           html+=options
           return html{code}
           

          Please help me with this issue

           
          I am trying to fetch a list of branches from git in the active choice reactive reference parameter.I am using the run *groovy script* option.

          But the script is ran twice when I check the tomcat logs.

          Because of which the drop down is rendered twice.

          Please find the below script
          {code:groovy}
          def html=
           '''
           <div style="padding-top:-2em;margin-left:1em;">
           <select id="module" style="height:2.2em;width:10.8em" name="value">
           <option value="">Select...</option>
           '''
           def cmd = ["/bin/bash", "-c","sudo sh /home/centos/JenkinScripts/dynamicChoices/getBranchesFromGit.sh https://KGJenkins@bitbucket.org/vtakru/escloudadmin.git"]
           def sout = new StringBuffer()
           def serr = new StringBuffer()
           // Run the command
           println "running "+cmd
           def proc = cmd.execute()
           proc.consumeProcessOutput ( sout, serr )
           proc.waitFor()
           def options=""
           sout.tokenize().each{ branch->
           if(branch.contains("refs/heads/")){
           branch=branch.minus("refs/heads/")
           println "Branch "+branch
           options+="<option value=$branch>$branch</option>"
           }
           }
           html+=options
           return html{code}
           

          Please help me with this issue

           

            People

            • Assignee:
              kinow Bruno P. Kinoshita
              Reporter:
              akash0092 Akash Muduli
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: