Last active
January 14, 2025 09:20
-
-
Save apua/8d3dcf76b11d7cd8bd865c8df4388337 to your computer and use it in GitHub Desktop.
List queued Jenkins jobs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vim: set filetype=groovy: | |
pipeline { | |
agent any | |
stages { stage('Hello') { steps { script { | |
// `Jenkins` comes from `jenkins.model.Jenkins`. | |
Jenkins.get().queue.items.findAll { it.task instanceof org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution.PlaceholderTask } .each { println("${it.task.runId} ${it.task.label}") } | |
}}}} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment