I am passing a multi-line string parameter using the option "this project is parameterized" with content similar to
{"name"="aaaa", "url" = "xxxx"},
{"name"="bbbb", "url" = "yyyy"}
Following is the piece of code through which I am able to get the each element:
node ('docker-maven-slave')
{
def string = params.details.split("\n")
echo "size is "+string.size()
for (i =0; i < string.size(); i++)
{
echo string[i]
}
}
How do I access the specific value of each element? Like "name" and "url".
Is this the right approach for the such requirement? If not please suggest me the appropriate one.
Tried the same way that is suggested here:
@NonCPS
def params()
{
params.details.split("\n").each {
param -> println "${param}"
}
}
stage 'read-string'
node ('docker-maven-slave')
{
params()
//echo("${string.name}")
}