The scenario I ran into is that I had a build queued and a build running that was spawned from an entirely different source than the jenkins api that would both eventually succeed or fail. I then spawned a build from the jenkins api a which would eventually fail. If I invoke the build with the block parameter set to true and another build gets queued up while my jenkins api job is building, when the job is done how do I tell if the job I spawned succeeded for sure?
jen = jenkinsapi.jenkins.Jenkins(os.getenv('JENKINS_URL'), 'user', 'password')
builds = jj.get_build_dict()
returned_value = jj.invoke(block=True, params=buildparams)
#
Do some code here to check if the build was a success
# I tried getting the build number to query out of the build dictonairy using jj.get_build_dict() again, but the problem is that there are multiple builds that my build could be. Is there a way in the jenkins cli or the jenkins api to get the build number back after calling the invoke method with the wait parameter?