This Issue Tracker is to report Jenkins issues, not seek support. Support questions should go to StackOverlflow, Community, or Gitter.
Nevertheless, these groovy bits will get you started. To list all jobs in the queue, if parameterized and why in the queue.
jenkins.model.Jenkins.instance.queue.items.each {job ->
println 'JOB: ' + job.task.getFullName() + " : " + job.task.isParameterized()
println ' ' + job.getInQueueForString() + " : " + job.getWhy() + " : " + job.getCausesDescription().trim()
def parameters = job.getAllActions().find{ it instanceof ParametersAction }?.parameters
parameters.each {
def dump = it.dump()
println " P: ${it.name}: ${dump}"
}
}
return
Clearing the queue:
Jenkins.instance.queue.clear()
def pattern = 'my_text'
def q = Jenkins.instance.queue
q.items.findAll { it.task.name.contains($pattern) }.each { job ->
println job.task.name
q.cancel(job.task)
} return
Closing out ticket.
This Issue Tracker is to report Jenkins issues, not seek support. Support questions should go to StackOverlflow, Community, or Gitter.
Nevertheless, these groovy bits will get you started. To list all jobs in the queue, if parameterized and why in the queue.
Clearing the queue:
// Clear the entire Job Queue: Jenkins.instance.queue.clear()
Closing out ticket.