naissa12
8/19/2016 - 3:10 PM

GroovyScript

def myFractureNO = ${FRACTURE_NO};
def myBuildNumber = ${BUILD_NUMBER};
def projectXml = new XmlSlurper().parseText("curl http://sparkbuilder.corp.adobe.com:8080/job/FractureAUT/api/xml".execute().text);
projectXml.build.each {
  if(it.number < myBuildNumber)
  {
      def jobXml = new XmlSlurper().parseText(("curl http://sparkbuilder.corp.adobe.com:8080/job/FractureAUT/" + it.number + "/api/xml").execute().text);

      if(1) {
        def myparams = jobXml.getAction(hudson.model.ParametersAction.class);
        for( p in myparams ) {
             if (p.name.toString == "FRACTURE_NO") {
                if (p.value.toString() == "$myFractureNO") {
                    println p.value.toString();
                }
            }
        }
      }
   }
}