Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cancel jobs in the queue from Jenkins console

Jenkins:

import hudson.model.*

def q = Jenkins.instance.queue

q.items.findAll.each { q.cancel(it.task) }

Or:

import hudson.model.*

def q = jenkins.model.Jenkins.getInstance().getQueue()

def items = q.getItems()

for (i=0;i<items.length;i++){

 items[i].doCancelQueue()

}