Hi,

I have a requirement to retrieve the current job name after configuring the 
job. Sending an api REQUEST gives me an XML using which i can retrieve all 
the current jobs that are being built?

Code Snippet:

import org.dom4j.io.*;

import org.dom4j.*;

import java.net.*;

import java.util.*;

    public class Main {

        public static void main(String[] args) throws Exception {

            URL url = new 
URL("http://your-hudson-server.local/hudson/api/xml";);

            Document dom = new SAXReader().read(url);

for( Element job : (List<Element>)dom.getRootElement().elements("job")) {

                System.out.println(String.format("Job %s has status %s",

                    job.elementText("name"), job.elementText("color")));

            }

        }

    }

How can i achieve my aim to get the current project name from the project 
configuration window via xml/json??

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to