Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39458

input choice parameter needs to support a default value after timeout

      When I use the input parameter with the choice option. I expect that if the pipeline was triggered by a none human, and a timeout was reached while waiting for a particular input (personally a timeout shouldn't even have to come in play here) the choice param should at least go with the first option in the dropdown of choices as the default.

      I feel like this would be feature parity with the current implementation of the choices param option in the legacy job workflow.

      Thoughts?

          [JENKINS-39458] input choice parameter needs to support a default value after timeout

          Caley Goff added a comment -

          So I found an alternative work around... but it would be cool to do this

              try {
                  timeout(time: 10, unit: 'SECONDS') {
                      env.DEPLOY_SERVERS = input message: '', parameters: [[$class: 'ChoiceParameterDefinition', choices:'SERVER1,SERVER2\nSERVER1\nSERVER2', description: '', name: 'DEPLOY_SERVERS']]
                  }
              } catch (err) {
                  env.DEPLOY_SERVERS = 'SERVER1,SERVER2'
              }
          

          Caley Goff added a comment - So I found an alternative work around... but it would be cool to do this try { timeout(time: 10, unit: 'SECONDS' ) { env.DEPLOY_SERVERS = input message: '', parameters: [[$class: ' ChoiceParameterDefinition ', choices:' SERVER1,SERVER2\nSERVER1\nSERVER2 ', description: ' ', name: ' DEPLOY_SERVERS']] } } catch (err) { env.DEPLOY_SERVERS = 'SERVER1,SERVER2' }

            Unassigned Unassigned
            caley Caley Goff
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: