pythonjenkinsjenkins-api

How do I retrieve the last good build with depth 2 with the Python JenkinsAPI


I'm trying to retrieve the build data for a specific build with depth 2 but the default is always 1

J = Jenkins(host,user,password)
job = J.get_job(job_name)
build_number = job.get_last_good_build()

It's not mentioned in the documentation, only how to create build object with depth 2.

How do I get it with depth 2 ?


Solution

  • In the latest version of the Jenkins API for Python there is the method get_job_info. It has the input argument depth.

    By the user Sven Krüger