[workflow] StringParameterDefinition exception when asking for a string

353 views
Skip to first unread message

Erwan de Ferrières

unread,
Dec 24, 2015, 3:53:50 AM12/24/15
to Jenkins Users
Hi all,

I've been trying to implement a simple workflow, and I want to get a value given by an user.
So I wrote this :

node {
    myvar = input message: 'Version?',
        parameters: [
            [$class: 'StringParameterDefinition', defaultValue: '', description: '', name: 'ver']
        ]

    echo 'Version is ' + $myvar.ver
}

Executing the workflow is giving me an exception, would you have any idea where it could come from ?
java.lang.UnsupportedOperationException: StringParameterDefinition as a class hudson.model.ParameterDefinition could mean either hudson.model.StringParameterDefinition or com.seitenbau.jenkins.plugins.dynamicparameter.StringParameterDefinition
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:226)

I'm using the latest jenkins version (1.643) as for the workflow plugin.

Best regards,

Erwan

Baptiste Mathus

unread,
Dec 24, 2015, 5:23:18 AM12/24/15
to jenkins...@googlegroups.com
Does it work if you use instead:

[$class: 'hudson.model.StringParameterDefinition', defaultValue: '', description: '', name: 'ver']

?


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/77a06d17-0076-4be6-972f-86a6045e5d1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Erwan de Ferrières

unread,
Dec 24, 2015, 5:38:45 AM12/24/15
to Jenkins Users, bma...@batmat.net
Yes, it works !

thanks
Reply all
Reply to author
Forward
0 new messages