Jenkins command to get number of builds in queue

Lokith picture Lokith · Jul 10, 2015 · Viewed 25.7k times · Source

I am trying to get the number of builds in the Jenkins Build Queue.

May I know the Jenkins command to get the number of builds running in the queue ?

Answer

Gerold Broser picture Gerold Broser · Jul 10, 2015

See Jenkins' Remote access API.

Access the API description with:

  http://<Your Jenkins>/api/

and the actual data with:

  http://<Your Jenkins>/api/xml

The Build queue has its own separate API:

  http://<Your Jenkins>/queue/api/

with its data:

  http://<Your Jenkins>/queue/api/xml