Created
March 23, 2020 18:07
-
-
Save marcosborges/443add5829b914ffc04ef2445c55e318 to your computer and use it in GitHub Desktop.
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
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 |
getting error
[test] $ groovy C:\Jenkins\workspace\test\hudson6410766321823746284.groovy
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: Cannot run program "groovy" (in directory "C:\Jenkins\workspace\test"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
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
kindly add read me file about the scripts