user6136315 user6136315 - 1 year ago 163
Groovy Question

List total number of current builds running for a job on Jenkins

I would like to monitor how many concurrent builds running for a job on Jenkins using groovy script console.

Using this I'm able to get the last build status. I need to get the count of current builds that are running. Can someone help me on this?

def item = hudson.model.Hudson.instance.getItem("<JOB-NAME>")
def build = item.getLastBuild()

println build.isInProgress()

Answer Source

Try this:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download