-
Task
-
Resolution: Fixed
-
Critical
-
None
-
Jenkins 2.107.3
I am using jenkinsfile active choice reactive parameter as below:
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']]], ]) ])
So in the script, I am passing the managed files id of the below groovy script. This works fine when I pass it as a parameter and pass this groovy script but when I pass it in jenkins file as mentioned above, it just populates "ERROR" in code_branch_name.
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("\\^
\{\\}
", '') |
|
} |
- duplicates
-
JENKINS-63284 Add support to Pipeline API
- Open