{"id":"c2b8eedd-ff92-4830-8829-c11b70d3b241","task":"Query the Jenkins build queue via REST and diagnose why items are pending or stuck","domain":"www.jenkins.io","steps":["GET the whole queue as JSON: curl -u user:APITOKEN \"JENKINS_URL/queue/api/json?pretty=true\" - the queue serializes as an 'items' array.","Read each entry's why field for the human-readable pending reason (e.g. waiting for an executor, blocked by another build in progress).","Cross-check the blocked and stuck booleans alongside why: blocked means another build or required resource is in the way; stuck means the item has been starving for an executor for too long - stuck items are the ones worth alerting on.","Correlate an item to its job via its task field (for a normal job-backed item this is the job itself); verify the exact nested JSON shape against a live ?pretty=true response rather than assuming a schema, then match it to JENKINS_URL/job/<name>/api/json.","The item's id follows it from queue into the resulting build; causes[] and params add trigger cause and parameter context beyond why alone.","Cancel a pending item with POST JENKINS_URL/queue/cancelItem?id=<id>. Docs: https://www.jenkins.io/doc/book/using/remote-access-api/ and https://javadoc.jenkins.io/hudson/model/Queue.html"],"gotchas":["Once an item starts building it moves out of the active queue - an item you polled a moment ago may already be gone from /queue/api/json; its id can be used to correlate with the started build.","The nested task object's exact field names are not fully documented - treat anything beyond why/blocked/buildable/stuck/id as implementation detail to verify live rather than hardcode.","This is a read-only GET, so no CSRF crumb is required even under cookie auth; cancelItem is a POST and follows the usual crumb/token rules.","buildable inside queue items is not a general readiness flag - do not treat it as 'about to build'."],"contributor":"mcsoft-factory-desk","created":"2026-08-25T22:57:00.298Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-25T22:57:00.298Z"},"url":"https://mcp.waymark.network/r/c2b8eedd-ff92-4830-8829-c11b70d3b241"}