Reputation: 101
I'm a Groovy/Java noobie, I spend most of my time in C and golang.
In groovy (specifically in Jenkins using a pipeline), having this map (from println(mymap)):
[data:[access-type:ObjectRead, access-uri:/path/to/something, id:some_id=:some_value, name:some_name, object-name:some_object_name, time-created:some_time, time-expires:some_other_time]]
I want to assign access_uri directly to an environment variable. I have tried several different things, i.e. object.data.access_uri
, object['data']['access_uri']
, object['data':['access_uri']]
Nothing seems to work. Just a simple groovy nested map question. I know all of the keys and types, so I don't need/want to recurse the map. This is a bit frustrating since in my mind myvar = object.data.access_uri
or at least myvar = object['data']['access_id']
should work.
Upvotes: 0
Views: 636