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

Dynamically allow user to provide information in "Input text box" field for Active Choices Reactive Reference Parameter

    XMLWordPrintable

Details

    • Improvement
    • Status: Fixed but Unreleased (View Workflow)
    • Major
    • Resolution: Not A Defect
    • active-choices-plugin
    • Jenkins ver. 2.107.2
      Active Choices Plug-in v2.1
      Dynamic Extended Choice Parameter Plug-In v1.0.1
      Extended Choice Parameter Plug-In v0.76

    Description

      We have a scenario where if user selects an option to install rpm (choice parameter) then display an additional field for user to provide input rpm package info in Jenkins UI.

       Please see Input text box disabled.png and Install input text box field.png for reference.
       

      If user selects option as rollback (choice parameter) then don't  display any additional parameters in Jenkins UI.

      Please see Rollback still displays input text box field.png for reference.

      Note:- "RPM_Package_Action" is an active choice reactive reference parameter
      "packagenames" is an active choice parameter

      Let me know if any additional information is required.

      Thanks,
      Pavan.

       

       

       

      Attachments

        Activity

          This behavior is already present in AC Reactive Reference. Return a 'Formatted HTML' parameter  (not an Input Text Box) of <input> type and insure that under advanced options you select 'Omit value filed' You can even provide a default value that can be further edited by the user.

          Something like this would work:

          return """<input name="value" value="${ReactiveRefParam}" class="setting-input" type="text">"""

          ioannis Ioannis Moutsatsos added a comment - This behavior is already present in AC Reactive Reference. Return a 'Formatted HTML' parameter   (not an Input Text Box) of <input> type and insure that under advanced options you select 'Omit value filed' You can even provide a default value that can be further edited by the user. Something like this would work: return   """<input name="value" value="${ReactiveRefParam}" class="setting-input" type="text">"""
          jenbeg Hao Maio added a comment -

          The return statement doestn work ... at least the ${ReactiveRefParam} resolves to empty

          jenbeg Hao Maio added a comment - The return statement doestn work ... at least the ${ReactiveRefParam } resolves to empty

          You understand of course that ${ReactiveRefParam} is either a referenced parameter (from upstream input) or a variable computed in within the code block of the AC Reactive Reference. If you are still having difficulty, please, submit your configuration for me to provide additional feedback. Bets regards

          ioannis Ioannis Moutsatsos added a comment - You understand of course that ${ReactiveRefParam} is either a referenced parameter (from upstream input) or a variable computed in within the code block of the AC Reactive Reference. If you are still having difficulty, please, submit your configuration for me to provide additional feedback. Bets regards
          meghana_v Meghana V added a comment -

          How do I access these input values in jenkins pipeline?

          meghana_v Meghana V added a comment - How do I access these input values in jenkins pipeline?

          Not sure if that will work well with pipelines meghana_v, the plug-in is not developed with pipelines in mind (though it may work). It's designed for the HTML DOM of Jenkins UI, which can act different when using pipelines.

          kinow Bruno P. Kinoshita added a comment - Not sure if that will work well with pipelines meghana_v , the plug-in is not developed with pipelines in mind (though it may work). It's designed for the HTML DOM of Jenkins UI, which can act different when using pipelines.

          Hi pavan_tatikonda

          The use case you have is one of the most classical examples of active-choices parameters. Take a look at the plugin readme for examples with source code.

          You need to reference the parameter by name as ioannis pointed in comments above, and then that should work - as long as you have a FreeStyle job, as cron/pipeline/remote triggered jobs are still work-in-progress in another issue.

          If you feel like you still have the issue, please provide a config.xml and/or steps to reproduce the issue, and feel free to re-open it.

          Thanks!
          Bruno

          kinow Bruno P. Kinoshita added a comment - Hi pavan_tatikonda The use case you have is one of the most classical examples of active-choices parameters. Take a look at the plugin readme for examples with source code. You need to reference the parameter by name as ioannis pointed in comments above, and then that should work - as long as you have a FreeStyle job, as cron/pipeline/remote triggered jobs are still work-in-progress in another issue. If you feel like you still have the issue, please provide a config.xml and/or steps to reproduce the issue, and feel free to re-open it. Thanks! Bruno

          People

            kinow Bruno P. Kinoshita
            pavan_tatikonda Venkata Siva Naga Tatikonda
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: