title: What URL will get the status code (result) of the last Jenkins job?
body: <p>I am wondering if anyone knows what URL is required (as a GET or POST) that will get the status code (result) of the last Jenkins job  (when the build# is not known by the client calling the GET request)?   I just want to be able to detect if the result was RED or GREEN/BLUE .</p>
  
  <p>I have this code sample, but I need to adjust it so that it works for Jenkins, for this purpose (as stated above):</p>
  
  <pre><code>public class Main {
      public static void main(String[] args) throws Exception {
          URL url = new URL("http://localhost/jenkins/api/xml");
          Document dom = new SAXReader().read(url);
          for( Element job : (List&lt;Element&gt;)dom.getRootElement().elements("job")) {
              System.out.println(String.format("Name:%s\tStatus:%s",
                  job.elementText("name"), job.elementText("color")));
          }
      }
  }
  </code></pre>
  
  <p>Once I figure out the answer, I will share a full example of how I used it.  I want to create a job that collects information on a test suite of 20+ jobs and reports on all of them with an email.</p>