You can configure the parameters for the current job (in a Scripted 
Pipeline) with:

def parameterList = [stringParam(name: 'Test', value: 'TestValue')]
properties(parameters(parameterList)

This will replace all parameters of your job with the contents of 
parameterList.


On Monday, 3 August 2020 23:03:39 UTC-7, Gajanan Mahajan wrote:
>
> I get all parameters of a build using -
>
>     def myparams = 
> currentBuild.rawBuild.getAction(ParametersAction).getParameters()
>
> `myparams` is object of 
> `java.util.Collections$UnmodifiableRandomAccessList` hence if try  to add 
> another parameter to it like  -
>
>     myparams.add([$class: 'StringParameterValue', name: 'Test', value: 
> "TestValue"])
>
> then it fails with error - 
>
>     java.lang.UnsupportedOperationException
>
> Please guide how to add parameter to existing parameters.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/723fed16-1561-4e23-b925-f3e01778f8bdo%40googlegroups.com.

Reply via email to