Skip to main content

Pipeline: How to manage user inputs

Comments

14 comments

  • Sumit Nagal

    It would be nice if we have link on input box, to input link otherwise user won't get it, where to input values
    link -> http://<jenkins URL>/<JobNumber>/input/

    1
  • Goutham Nithyananda

    I have few questions here.

    1.How do i make the user input optional

    2.If i have a cron to run a build periodically, is it possible to run the build by automatically taking default value defined for user input defined or assuming that value as null without user interference??

    0
  • Carlos Rodriguez Lopez

    try{} catch{} statements could help you to achieve what you requested. Please review the following articles:

    And adapt the above scripts to your particular case

     

     

     

     

    1
  • Goutham Nithyananda

    thanks, I tried the second example and looks like when ever there is a timeout the getUser() is returning null , which ideally should return 'SYSTEM' as per example. please help here

     

     def user = err.getCauses()[0].getUser()
       if('SYSTEM' == user.toString()) { // SYSTEM means timeout.
            didTimeout = true
        }
    0
  • Bert Roos

    It would be very helpful if you could extend this example with a variant in the declarative syntax. I'm looking into a combination of this article (getting user input) and conditions (what's described here).

    Thanks in advance!

    2
  • Arati Kulkarni

    How do i use it to accept gitparameter

    0
  • Nabil Tahri

    Is there a way to response to the input function from another pipeline not from a REST API???

    0
  • Irma Jakic

    Hi, does anyone know how can I stop waiting for user input? I have two parallel stages, and if something happens in one I want to stop waiting for user input (which is in second parallel stage)

    0
  • Rainer Haseneder

    Where do I have to enter all these "code lines", please ?

    0
  • Denys Digtiar

    Hi Rainer,

    This is for Jenkins Pipeline (https://jenkins.io/doc/book/pipeline/). Therefore, you would use it as part of your `Jenkinsfile`

    0
  • Yves Schumann

    Hi@all,

    how can I trigger such a pipeline from another pipeline with given parameters? If I use 

    build job: 'pipelineRequestingInput', parameters: [string(name: 'FOO', value: "${pom.version}")], wait: true

    as usual for a parameterized job, it just hangs and wait for user input. So is there an option to just say "go-and-use-given-values"?

    0
  • Denys Digtiar

    Hi Yves,

    The `input` step is different from the parametrized project. the `build` step can start a new build of a project whether it is parameterized or not but it cannot resume a Pipeline paused on the `input` step.

    0
  • Ranjith Kumar

    Hi all,
    How i can fetch in inputs parameter from DB.
    I mean i don't want to hard code my input values.All values should from DB.
    Is three any plugin available to do this.

    How to achieve this

    0
  • Hawk Base

    I have a git hub repository that got has single folder.As of now, the developer team using only one folder - dev. The folder is string parametrized. When user clicks the build it automatically goes to the git hub repo/ $Folder and build the code in it. As of now when the user submit build, it automatically builds the code from the repo based on a particular IP for the dev as well.

    Now, the dev team has four folders - dev, QA, Prod 1 and Prod 2  and each has different IP address. I created 2 choice parameters :

    First choice parameter: dev, QA, Prod 1 and Prod 2

    Second Choice parameter: IP of each environment.

    When I click build, it;s giving me options listed above. Now when I click the options and select build, I am struck with the following:

     What's the Folder name do I need to give now? In the earlier code, it automatically input the dev name to the folder and select the IP from the file. But now, I am not able to do this?

    What needs to be modified so that it selects the code on the folder i.e if I select Prod 1 and the corresponding IP , it must go to the github repo/Prod1 folder and build on the code

     

    0

Please sign in to leave a comment.

About CloudBees Support

Our Support Engineers are available to help with any questions or problems you may have with any of our products.