Hi Sven! You were nearly there :-)
println(project.getFullName()+ ' ' + project.getNextBuildNumber()); If you need the current build number you have to subtract 1. Kind regards, Andreas Schilling CAE Processes & Data Management ------------------------------------------------------------------- Dipl. Inf. Andreas Schilling Senior Software Architect TWT GmbH Science & Innovation Bernhäuser Str. 40 - 42 73765 Neuhausen Tel: +49 - 7158 - 17 15 - 673 E-Mail: [email protected] -------------------------------------------------------------------- www.twt-gmbh.de -------------------------------------------------------------------- Geschäftsführung: Dimitrios Vartziotis, Joachim Laicher (stv.) Registergericht: Amtsgericht Stuttgart, HRB Nr. 212778 Umsatzsteuer: ID-Nr.: DE147841145 -------------------------------------------------------------------- Von: Sven Finsterwalder <[email protected]> An: [email protected] Datum: 20.11.2012 09:13 Betreff: GetBuildnumber of started downstrem Job groovy Gesendet von: [email protected] Hello, i try to get the buildnumber of a started downstream Job with groovy. Currently i got this: def deploymentJob = Jenkins.getInstance().getItemByFullName('deployment-universal-automatic-2.2') println(deploymentJob.getDownstreamProjects()) List<AbstractProject> childs = deploymentJob.getDownstreamProjects() for (Iterator<AbstractProject> iterator = childs.iterator(); iterator.hasNext();) { AbstractProject project = iterator.next(); println(project.getFullName()); } How can i now get the buildnumber of the DownstreamJob? I have read the documentation but i can not find a way to do it, please help me. Thanks!
