The Declarative model for Jenkins Pipelines has a restricted subset of syntax that it allows in the stage
blocks - see the syntax guide for more info. You can bypass that restriction by wrapping your steps in a script { ... }
block, but as a result, you'll lose validation of syntax, parameters, etc within the script
block.