How to check the build queue using cURL

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Before Bamboo is backed up, the build queue has to be empty so that it doesn't cause any data inconsistency. 

Solution

Use the cURL command to check the build queue endpoint before performing any backup:

cURL
curl -u <ADMIN_USERNAME>:<PASSWORD> <BAMBOO_URL>/build/admin/ajax/getDashboardSummary.action

Sample outputs:

Empty queue
{"status":"OK","builds":[],"agentSummary":" 1 online agent "}
Jobs in the queue
{"status":"OK","builds":[{"status":"QUEUED","messageType":"ERROR","messageText":"No agent can build this job.","hasReadPermission":true,"hasBuildPermission":true,"itemType":"BUILD","resultKey":"BSP49354-TES-JOB1-2","buildResultKey":"BSP49354-TES-JOB1-2","planResultKey":"BSP49354-TES-2","planKey":"BSP49354-TES","jobKey":"BSP49354-TES-JOB1","projectName":"BSP-49354","chainName":"testasufh","jobName":"Default Job","planName":"BSP-49354 - testasufh","buildNumber":2,"isBranch":false,"triggerReason":"Manual run by admin","queueIndex":1}],"agentSummary":"No agents online"}
Last modified on Nov 25, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.