Access individual Parameters from input (MAP) within decalarative pipeline

Jenkins setup:

Hi All,

Jenkins: 2.452.1
OS: Linux - 3.10.0-1160.105.1.0.1.el7.x86_64
Java: 11.0.23 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)

I don’t have much knowledge of Jenkins but I’m trying to build a declarative pipeline where I want the build to pause and give the user the need to provide 2 input parameters.

TAG_PARAMETERS = input id: 'no-tag-provided', 
                    message: "Provide tag details here.  The previous version was: ${env.GIT_LAST_TAG}", 
                    ok: 'Continue', 
                    parameters: [
                        string(name: 'TAG_IDENTIFIER', defaultValue: '', description: 'Tag ID'),
                        text(name: 'TAG_DESCRIPTION', defaultValue: '', description: 'Tag Description')
                    ];

This is what I get back when I run the build and provide values:

{TAG_DESCRIPTION=This is a test, TAG_IDENTIFIER=v1.0.2}

How do I get the values from this map?

Any help would be great as I’ve been scratching my head on this for some time now.

Thanks

Andy

It’s groovy and what you get is a map so e.g. TAG_PARAMETERS.TAG_IDENTIFIER should be possible

1 Like