Dynamic parameter on Jenkins Pipeline depending on branch Dynamic parameter on Jenkins Pipeline depending on branch jenkins jenkins

Dynamic parameter on Jenkins Pipeline depending on branch


If you haven't found a way yet, you could just add the elements to the parameters list conditionally like this

def list = []if (env.BRANCH_NAME != 'master') {    list.add(booleanParam(description: 'Merge master to this branch', name: 'merge_master', defaultValue: false))}//example list.add(otherParams)//finallyproperties([parameters(list)])

More on adding to lists in groovy can be found here.