Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marcosborges/443add5829b914ffc04ef2445c55e318 to your computer and use it in GitHub Desktop.
Save marcosborges/443add5829b914ffc04ef2445c55e318 to your computer and use it in GitHub Desktop.
def total = 0
def findInScript = ""
def findInName = ""
Jenkins.getInstance().getAllItems().each {
if(it?.getDescriptor().getDisplayName() == "Pipeline") {
if (
it.getDefinition()?.getScript()?.contains(findInScript) &&
it.getFullName().contains(findInName)
){
println "${it.getFullName()}"
total++
}
}
}
total
@marcosborges
Copy link
Author

Hi @mydearmuthu1978
This script is to be run in the Jenkins script console. It is in the management area near the end of the items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment