title: Jenkinsfile Active choice parameter plugin(Dynamic git branch names)
body: <p>I need to use Active Choices Reactive Parameter in my jenkinsfile with below groovy script:</p>
  
  <pre><code>def gettags = ("git ls-remote -t -h https://USER:PASS@bitbucket.org/project_name.git").execute()
  return gettags.text.readLines().collect { 
    it.split()[1].replaceAll('refs/heads/', '').replaceAll('refs/tags/', '').replaceAll("\\^\\{\\}", '')
  }
  </code></pre>
  
  <p>How do I define this param in my jenkinsfile?</p>
  
  <p>I have used below code :</p>
  
  <pre><code>properties([ 
      parameters([
          [$class: 'ChoiceParameter', choiceType: 'PT_SINGLE_SELECT', 
                    description: 'Select code branch name', 
                    name: 'code_release_branch', 
                    script: [$class: 'GroovyScript', 
                    fallbackScript: [classpath: [], sandbox: false, 
                    script: 'return ["error"]'], 
                    script: [classpath: [], sandbox: false, 
                    script: '''def gettags=("git ls-remote -t -h ssh://git@abc.com/code/code.git").execute()return gettags.text.readLines().collect{it.split([1].replaceAll('refs/heads/','').replaceAll('refs/tags/','').replaceAll("\\^\\{\\}",'')}}''']]],
      ])
  ])
  </code></pre>
  
  <p>This gives "error" output in parameter</p>
  
  <p>Please note that this groovy script is to get branch names from git dynamically</p>
  
  <p>I have tried one more thing of putting this groovy script in Jenkins managed files and give the id as a parameter to script as below , but still same issue:</p>
  
  <pre><code>properties([ 
      parameters([
          [$class: 'ChoiceParameter', 
           choiceType: 'PT_SINGLE_SELECT', 
           description: 'Select code branch name', 
           name: 'code_release_branch', script: [
               $class: 'GroovyScript', 
               fallbackScript: [
                     classpath: [],
                     sandbox: false, 
                     script: 'return ["ERROR"]'
               ], 
               script: [
                     classpath: [], 
                     sandbox: false, 
                     script: '6cd2a674-c02d-44b0-87cb-b32f1fcdc0c3'
               ]
          ]],
      ])
   ])
  </code></pre>