Answers: <p>What you are looking for is at the <a href="https://github.com/jenkinsci/promoted-builds-plugin#job-dsl-support" rel="nofollow noreferrer">bottom</a> of the GitHub <a href="https://github.com/jenkinsci/promoted-builds-plugin" rel="nofollow noreferrer">README</a> describing <a href="https://plugins.jenkins.io/job-dsl" rel="nofollow noreferrer">Job DSL</a> for the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin" rel="nofollow noreferrer">Promoted Builds Plugin</a>. 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 <a href="https://github.com/jenkinsci/job-dsl-plugin/wiki" rel="nofollow noreferrer">Job DSL plugin</a> wiki. You can also ask questions in the Job DSL <a href="https://groups.google.com/forum/#!forum/job-dsl-plugin" rel="nofollow noreferrer">forum</a> or simply read the <a href="https://github.com/jenkinsci/job-dsl-plugin/wiki/Job-DSL-Commands" rel="nofollow noreferrer">documentation</a>. Here is a <a href="https://github.com/codecentric/job-dsl-promotions-plugin" rel="nofollow noreferrer">plugin</a> that extends the promotion syntax of the DSL.</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-03-14T03:41:39.903Z
Answers: 2017-03-14T03:41:39.903Z
Answers: Jiri Klouda
Body: <p>I'm using the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin" rel="nofollow noreferrer">Promoted Builds Plugin</a> and I'd like to promote my freestyle job to have a gold star when a certain value in my output is above a given threshold (e.g. above 1.00).</p>
  
  <p>Here is a sample output from backtesting jobs:</p>
  
  <pre><code>Pass  Profit Total trades Profit factor Expected Payoff Drawdown $ Drawdown %
     1  622.71           76          1.38            8.19     526.77       4.94
    10  301.09           36          1.38            8.36     526.77       4.93
    14  240.96           62          1.18            3.89     589.60       5.60
  </code></pre>
  
  <p>My aim is to promote the build to gold when the first line right after the header line has a <code>Profit factor</code> column value above <code>1.00</code> and only to silver star when it is below.</p>
  
  <p>How can this be achieved?</p>
  
Tags: <jenkins><jenkins-plugins>
Title: How to promote a build when certain value in output is above threshold?
UserDisplayName: kenorb
ThreadText: # How to promote a build when certain value in output is above threshold?
  
  (Asked by: username_0 on 2017-02-28)
  
  I'm using the [Promoted Builds Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin) and I'd like to promote my freestyle job to have a gold star when a certain value in my output is above a given threshold (e.g. above 1.00).
  
  Here is a sample output from backtesting jobs:
  
  ```
  Pass  Profit Total trades Profit factor Expected Payoff Drawdown $ Drawdown %
     1  622.71           76          1.38            8.19     526.77       4.94
    10  301.09           36          1.38            8.36     526.77       4.93
    14  240.96           62          1.18            3.89     589.60       5.60
  
  ```
  
  My aim is to promote the build to gold when the first line right after the header line has a `Profit factor` column value above `1.00` and only to silver star when it is below.
  
  How can this be achieved?
  
  **Tags:** jenkins, jenkins-plugins
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-03-14. Score: 4 | Accepted answer
  
  What you are looking for is at the [bottom](https://github.com/jenkinsci/promoted-builds-plugin#job-dsl-support) of the GitHub [README](https://github.com/jenkinsci/promoted-builds-plugin) describing [Job DSL](https://plugins.jenkins.io/job-dsl) for the [Promoted Builds Plugin](https://wiki.jenkins-ci.org/display/JENKINS/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](https://github.com/jenkinsci/job-dsl-plugin/wiki) wiki. You can also ask questions in the Job DSL [forum](https://groups.google.com/forum/#!forum/job-dsl-plugin) or simply read the [documentation](https://github.com/jenkinsci/job-dsl-plugin/wiki/Job-DSL-Commands). Here is a [plugin](https://github.com/codecentric/job-dsl-promotions-plugin) that extends the promotion syntax of the DSL.
  
  
  ---
  
  