unable to get the last build number fro the jobs

Bug #1649862 reported by RASHMI BS
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python Jenkins
Invalid
Undecided
Unassigned

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

Changed in python-jenkins:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.