I have the below pipeline:
I want that once I choose in the InstllationType the value 'Recreate', some fields will disappear. is it possible to do it with an active choice parameter? if not, is there any other way for doing it?
- 339
- 2
- 9
- 21
-
By your server name I detected that you work in the same company as I did. And I implemented there exactly same thing successfully. So you can take an example from what I did (consult with Franklin L., cause I left company and don't have an access to the Jenkins). And don't forget to post it here please when find out. – Michael A. Apr 15 '20 at 08:57
-
That's possible You can see my solution in this link https://stackoverflow.com/a/75990270/4146360 – Jheison Rodriguez Apr 11 '23 at 21:30
1 Answers
No, this is not possible, because the number and type of parameters for a build are fixed and cannot be modified on-the-fly. The only way to modify which parameters show up in the "build with parameters" UI is to change the job configuration, which alters the parameters permanently.
In my opinion, if you need to do several different tasks which require several different input parameters (such as "build", "test", "install", "deploy", etc.), you should have separate jobs in Jenkins for each task. I personally think it is a good ideal in general to avoid complex Jenkins jobs which require a lot of input parameters and try instead to simplify job configuration in order to reduce the likelihood of subtle, difficult-to-debug errors when executing jobs.
- 2,952
- 7
- 15