How to promote a build when certain value in output is above threshold?
What you are looking for is at the bottom of the GitHub README describing Job DSL for the Promoted Builds Plugin. Link to GitHub is on every plugin's page. There are also links to plugins it depends on and you should read the documentation for those like the Job DSL plugin wiki. You can also ask questions in the Job DSL forum or simply read the documentation. Here is a plugin that extends the promotion syntax of the DSL.