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 ?
This single bash variable definition using the awesome "jq" utility was all I needed to get the queue length:
QUEUE_SIZE=$(curl -s -k http:///queue/api/json | jq '.items | length')
Hope this helps.