← Back to team overview

python-jenkins-developers team mailing list archive

[Bug 1649862] [NEW] unable to get the last build number fro the jobs

 

Public bug reported:

last_build_number = server.get_job_info('api-
test')['lastCompletedBuild']['number']

i  have tried to use the above code to get the last  completed job for
the currently stable build in  jenkins

i don't see the  desired result

i could see the below error 
TypeError: 'NoneType' object has no attribute '__getitem__'

and when i have tried this

last_build_number = server.get_job_info('api-
test')['lastCompletedBuild']

it returned 1

where in the job contains 100+  builds


please share the code snippet to get the latest successfull build number from jenkins

** Affects: python-jenkins
     Importance: Undecided
         Status: Invalid

** Changed in: python-jenkins
       Status: New => Invalid

** Converted to question:
   https://answers.launchpad.net/python-jenkins/+question/406747

-- 
You received this bug notification because you are a member of Python
Jenkins Developers, which is subscribed to Python Jenkins.
https://bugs.launchpad.net/bugs/1649862

Title:
  unable to get the last build number fro the jobs

Status in Python Jenkins:
  Invalid

Bug description:
  last_build_number = server.get_job_info('api-
  test')['lastCompletedBuild']['number']

  i  have tried to use the above code to get the last  completed job for
  the currently stable build in  jenkins

  i don't see the  desired result

  i could see the below error 
  TypeError: 'NoneType' object has no attribute '__getitem__'

  and when i have tried this

  last_build_number = server.get_job_info('api-
  test')['lastCompletedBuild']

  it returned 1

  where in the job contains 100+  builds

  
  please share the code snippet to get the latest successfull build number from jenkins

To manage notifications about this bug go to:
https://bugs.launchpad.net/python-jenkins/+bug/1649862/+subscriptions