Something like the below snippet should work: import org.jenkinsci.plugins.pipeline.utility.steps.shaded.org.yaml.snakeyaml.Yaml
@NonCPS def readYaml(data) { return (new Yaml()).dump(data) } println readYaml([name: "foo", surname: "bar", age: 1]) writeYaml implementation uses that particular Class and method: - https://github.com/jenkinsci/pipeline-utility-steps-plugin/blob/59f3c669ca6125a10dd5e80907006b06903d7d04/src/main/java/org/jenkinsci/plugins/pipeline/utility/steps/conf/WriteYamlStep.java#L194 My 2 cents -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4ecacb54-8114-4a59-9946-ee84a66cec90%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.