In Pipeline, doing params.get as recommended by Jesse Glick in:
doesn't work because Groovy Map.get(Object, Object) actually tries to modify the map; whereas the params Map is an UnmodifiableMap.
When I tried this code, I got the exception:
I recommend instead Map.getOrDefault, which does not try to modify the Map. Pull request incoming for an update to documentation.