import jenkins.model.* def q = Jenkins.instance.queue q.items.findAll { it.task.name.startsWith('job_name_') }.each { q.cancel(it.task) }