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

Not able to use git, sh, pwd etc in active choice parameter script

      git, sh groovy scripts generated by pipeline script generator are not working in active choice parameter. The same work in pipeline script.
      For example following groovy script:
      git branch: 'branch', credentialsId: 'gitCred', url: 'https://some.ur.com/somthing.git'
      gives exception groovy.lang.MissingMethodException: No signature of method: Script1.git()

      sh "ls" would give exception groovy.lang.MissingMethodException: No signature of method: Script1.sh()

      Same exception is thrown while using pwd(), node() in active choice parameter groovy script.

      Note that in pipeline script everything works as expected.

          [JENKINS-43752] Not able to use git, sh, pwd etc in active choice parameter script

          J H added a comment - - edited

          I have the same Problem. Is there anything new?

          J H added a comment - - edited I have the same Problem. Is there anything new?

          My understanding is that these scripts are Groovy DSL and not pure Groovy. I would not expect them to work in Active Choices, unless the appropriate DSL libraries are included. Have you tried that?

          Ioannis Moutsatsos added a comment - My understanding is that these scripts are Groovy DSL and not pure Groovy. I would not expect them to work in Active Choices, unless the appropriate DSL libraries are included. Have you tried that?

            kinow Bruno P. Kinoshita
            bipulr Bipul Raj
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: