jenkinsci / rest-list-parameter-plugin

A simple Jenkins parameter plugin that offers a list of values based on a REST call response.
https://plugins.jenkins.io/rest-list-parameter
GNU General Public License v3.0
10 stars 9 forks source link

[FEATURE] Multiple choice #19

Open jamesnswithers opened 3 years ago

jamesnswithers commented 3 years ago

Is your feature request related to a problem? Please describe. Be able to select multiple choices

Describe the solution you'd like An checkbox option in the configuration to set the select input as singular or multiple choice

Describe alternatives you've considered Multiple input parameters all pointing to the same webservice but very impractical

Additional context None

h1dden-da3m0n commented 3 years ago

Hi James!

First of all, thank you for the feature request! I currently cant say for sure if Jenkins offers the right Form control to accomplish this, but I'll have a look once I have the time. (currently a bit time limited) More importantly though I fear that the way how Jenkins handles build parameter values could turn out as a major blocker for this one unfortunately. (Just a heads up, unless you happen to know of a multi select parameter plugin besides the uni-choise plugin)

With all that said, I'll investigate how and if this could be realized as soon as I have the time.

NOTE: If you or any passing by developer wants to work on this, please feel welcome to do so! Just leave a note that you are working on it in that case.

ianwilliams1 commented 3 years ago

This very much seems to tied into how the parameter is used later on, which would complicate any implementation. We have a scenario using a string build parameter where we can enter multiple values, but then we have a groovy step that iterates over them (which then calls a another job with the the specific build parameter). That would not work in other multiple choice scenarios.

The Extended Choice Parameter does support multi-select, but the Extensible Choice Parameter does not. That may be a reference point to leverage (disclaimer: I've only used extended).

ps: OP's requested behavior also seems to be similar to how JIRA search selector options works, so may be an overall Jenkins implementation limitation.

h1dden-da3m0n commented 3 years ago

I thought about this a bit, the only way a multi select would be usable is if you have a script within your pipeline to iterate over the selected values and act according to what values are in that list then. I am not saying that it is impossible, but since the Jenkins UI does not provide such a control natively (at least as far as I can tell) I have to admin that this might be out of my reach :frowning_face:

/reason: I am no front-end developer, I don't really like JavaScript and I am pretty lost without a framework like Angular or Vue in the Web world (PHP would also be a possibility). The Extended Choice Parameter seems to provide the here requested functionality via JavaScript if I interpreted that right, same goes for the Active Choice plugin which can also offer a multi select parameter.

Finally, I will keep this open and see what I can do to maybe still realize the functionality on my own, but in the mean time give I will add the help wanted label. Thank you for your understanding!

jamesnswithers commented 3 years ago

Thanks both, i've used both Extended Choice Parameter and Active Choice plugin and whilst they can be tailored quite extensively they can be overly complicated especially for something as 'simple' as a multiple select.

I had a tinker on the weekend with this feature request and got something working in a similar fashion to both previously mentioned plugins where a string is passed through as a csv but i'm not sure how happy I am with it.