[JIRA] [workflow-plugin] (JENKINS-33271) Snippet generator creates wrong input statement with ChoiceParameter

11 views
Skip to first unread message

asotobueno@cloudbees.com (JIRA)

unread,
Mar 2, 2016, 8:44:05 AM3/2/16
to jenkinsc...@googlegroups.com
Alex Soto created an issue
 
Jenkins / Bug JENKINS-33271
Snippet generator creates wrong input statement with ChoiceParameter
Issue Type: Bug Bug
Assignee: Jesse Glick
Components: workflow-plugin
Created: 02/Mar/16 1:43 PM
Environment: Pipeline 1.14
Priority: Major Major
Reporter: Alex Soto

Using Snippet Generator for creating an input statement with choice parameter you get next sentence:

input message: 'Environment to Deploy', parameters: [[$class: 'ChoiceParameterDefinition', choices: ['local','pre'], description: '', name: 'environment']]

But then when you execute the script you get next exception:

java.lang.ClassCastException: hudson.model.ChoiceParameterDefinition.choices expects class java.lang.String but received class java.util.ArrayList
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:590)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:524)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:96)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:576)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.mapList(DescribableHelper.java:603)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:588)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:524)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.injectSetters(DescribableHelper.java:663)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:98)
	at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:103)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:133)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:113)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:15)
	at WorkflowScript.run(WorkflowScript:1)
	at ___cps.transform___(Native Method)
	at com.cloudbees.groovy.cps.impl.Cont
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

asotobueno@cloudbees.com (JIRA)

unread,
Mar 2, 2016, 9:08:01 AM3/2/16
to jenkinsc...@googlegroups.com
Alex Soto closed an issue as Duplicate
Change By: Alex Soto
Status: Open Closed
Resolution: Duplicate

asotobueno@cloudbees.com (JIRA)

unread,
Mar 2, 2016, 9:08:01 AM3/2/16
to jenkinsc...@googlegroups.com

melvyn.romero@gmail.com (JIRA)

unread,
Jul 11, 2016, 4:43:01 PM7/11/16
to jenkinsc...@googlegroups.com
Melvyn Romero commented on Bug JENKINS-33271
 
Re: Snippet generator creates wrong input statement with ChoiceParameter

Use this example, for fix the error, it work perfectly:

properties ([[$class: 'hudson.model.ParametersDefinitionProperty', parameterDefinitions: [[$class: 'hudson.model.ChoiceParameterDefinition', choices: 'Value1\nValue2' , description: '', name: 'unChoiceParameter']]]])

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages