Getting No such field found: field java.lang.String sinput error while running my Jenkinsfile.
I have developed a Jenkinsfile that would take a user input and further would run a command on remote machine taking the user input as a variable
stages {
stage("Interactive_Input") {
steps {
script {
def apiinput
def userInput = input(
id: 'userInput', message: 'This is my project',
parameters: [
string(defaultValue: 'None',
description: 'Enter the name of the service',
name: 'sinput'),
])
// Save to variables. Default to empty string if not found.
apiinput = userInput.sinput?:''
}
}
}
}