Declarative pipeline: "Data generation failure: null" in input step

41 views
Skip to first unread message

Sascha Schwarz

unread,
Aug 16, 2017, 5:51:44 AM8/16/17
to Jenkins Users
Hi!
The following Code just produces an empty dropdown list and an error message: Data generation failure: null

pipeline {
    options
{
        buildDiscarder
(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
   
}
    agent none
    stages
{
        stage
('input') {
            steps
{
                input
(
                    id
: 'userInput', message: 'Text goes here', parameters: [
                       
[ $class: 'DropdownAutocompleteParameterDefinition', name: 'MyName', dataprovider: [
                           
[$class: 'InlineJsonDataProvider', autoCompleteData: '[{"id":"1"},{"id":"2"}]'
               
]]]])
           
}
       
}
   
}
}


How do I use the InlineJsonDataProvider correctly?

Jenkins V 2.60.2
Autocomplete Parameter Plugin V 1.0

Thanks
Sascha

Victor Martinez

unread,
Aug 16, 2017, 6:36:05 AM8/16/17
to Jenkins Users
Hey,

It seems you are missing the displayVersion and valueExpression attributes.

The below snippet works, 

...

input id: 'userInput',  message: 'Text goes here', parameters:
    [[
        $class: 'DropdownAutocompleteParameterDefinition',
        name: 'MyName',
        dataProvider: 
        [
            $class: 'InlineJsonDataProvider', 
            autoCompleteData: '[{"id":"1"},{"id":"2"}]'
        ],
        displayExpression: 'id',
        valueExpression: 'id'
    ]]

...


Cheers

Sascha Schwarz

unread,
Aug 16, 2017, 11:09:51 AM8/16/17
to Jenkins Users
On Wednesday, 16 August 2017 12:36:05 UTC+2, Victor Martinez wrote:
Hey,

It seems you are missing the displayVersion and valueExpression attributes.

Thank you! :)

It seems that the displayVersion Parameter must not be null. :/

Thanks again
Sascha
Reply all
Reply to author
Forward
0 new messages