'Jenkins pipeline: Hide selected parameters in 'Build with Parameters'

The Jenkins pipeline job looks like: Need to hide 'releaseTag'

The partial Jenkinsfile(we use scripted pipeline) is:

properties([parameters([string(defaultValue: "", description: "List of components", name: 'componentsToUpdate'),
                        string(defaultValue: "refs%2Fheads%2Fproject%2Fintegration", description: "BuildInfo CommitID", name: 'commitId'),
                        string(defaultValue: "", description: "Tag to release, e.g. 1.1.0-integration", name: 'releaseTag'),
                        string(defaultValue: "", description: "Forked buildInfo repo. Be aware right commit ID!!!", name: 'fork')]),
                        [$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '7', numToKeepStr: '5']],
                        disableConcurrentBuilds()])
.
.
.

I wish to hide the 'releaseTag' parameter. The 'Hidden Parameter' plugin seems to be obsolete and I don't wish to use it. I referred to this thread which talks about passing the parameter within some hidden tag but when I referred to Jenkins pipeline documentation parameter syntax, I didn't find anything relevant to hiding a parameter.

How shall I proceed.

Note: I am a Jenkins beginner :)



Solution 1:[1]

It looks like been while but in case you are still looking for answer. You may use https://plugins.jenkins.io/extended-choice-parameter/ plugin.

This plugin has hidden option, so with this way you can hide some of the your parameters.

You can use in pipeline like;

extendedChoice defaultValue: 'test', description: '', name: 'hiddenParameter', 'PT_HIDDEN', value: 'test,test2'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 merdincz