How to check the build queue using cURL
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 -u <ADMIN_USERNAME>:<PASSWORD> <BAMBOO_URL>/build/admin/ajax/getDashboardSummary.action
Sample outputs:
{"status":"OK","builds":[],"agentSummary":" 1 online agent "}
{"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"}