[JIRA] (JENKINS-59033) Jenkinsfile Active Choice Parameter

4 views
Skip to first unread message

rashminair90@gmail.com (JIRA)

unread,
Aug 21, 2019, 11:26:03 AM8/21/19
to jenkinsc...@googlegroups.com
Rashmi Nair created an issue
 
Jenkins / Task JENKINS-59033
Jenkinsfile Active Choice Parameter
Issue Type: Task Task
Assignee: Bruno P. Kinoshita
Components: active-choices-plugin, pipeline
Created: 2019-08-21 15:25
Environment: Jenkins 2.107.3
Priority: Critical Critical
Reporter: Rashmi Nair

I am using jenkinsfile active choice reactive parameter as below:

 

properties([ parameters([ [$class: 'ChoiceParameter', choiceType: 'PT_SINGLE_SELECT', description: 'Select templo 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:PA...@bitbucket.org/project_name.git").execute()
  return gettags.text.readLines().collect {
  it.split()[1].replaceAll('refs/heads/', '').replaceAll('refs/tags/', '').replaceAll("\\^
{\\}

", '')

  }
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

rashminair90@gmail.com (JIRA)

unread,
Aug 21, 2019, 11:49:03 AM8/21/19
to jenkinsc...@googlegroups.com
Rashmi Nair updated an issue
Change By: Rashmi Nair
I am using jenkinsfile active choice reactive parameter as below:

 

properties([ parameters([ [$class: 'ChoiceParameter', choiceType: 'PT_SINGLE_SELECT', description: 'Select templo 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

| |return gettags.text.readLines().collect {|
| |it.split()[1].replaceAll('refs/heads/', '').replaceAll('refs/tags/', '').replaceAll("\\^

\ \ {\\}
", '')|
| |}|
Reply all
Reply to author
Forward
0 new messages