-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathgetScritpletJobACparameters.groovy
More file actions
42 lines (35 loc) · 1.21 KB
/
getScritpletJobACparameters.groovy
File metadata and controls
42 lines (35 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*** BEGIN META {
"name" : "getScritpletJobACparameters",
"comment" : "Prints usage of Groovy SCRIPTLETS in ALL JOB Active Choice PARAMETERS by searching JENKINS model",
"parameters" : [ 'scriptNameList'],
"core": "2.121",
"authors" : [
{ name : "Ioannis K. Moutsatsos" }
]
} END META**/
import hudson.model.*
//scriptNameListExample='UC_helper_GetBuildsByNumAsMap,H2_inMem_ParameterDB,AC_RefHelper_getParamValue'
scriptMap=[:]
scriptNameList.split(',').each{script->
scriptJob=[]
//all job name
jenkins.model.Jenkins.instance.getAllItems(FreeStyleProject.class).each {
it.properties.each{p->
if( p.value.class==hudson.model.ParametersDefinitionProperty){
p.value.getParameterDefinitions().each{pdn->
if (pdn in org.biouno.unochoice.UnoChoiceParameter && pdn.getScript().getClass()==org.biouno.unochoice.model.ScriptlerScript ){
if (pdn.getScript().scriptlerScriptId-'.groovy'==script){
scriptJob.add(it.name)
}
}
}
} //end each Parameter Definition Property
}
}
println "$script : Used in ${scriptJob.size} Job Build forms"
scriptJob.each{j->
println '\t'+j
}
scriptMap.put(script,scriptJob)
} //end each script
return null//scriptMap