I can look into the slave's status to find all projects tie to this slave. Is there a way, e.g. groovy script, to list all of them? We used to have half a dozen slaves, now want to consolidate them. I want to have a nicely list send out to the project team.
Asked
Active
Viewed 516 times
1
-
A similar question but not the same: http://stackoverflow.com/questions/30882670/list-all-jobs-which-were-running-on-a-specific-slave-node – Jirong Hu Jul 15 '16 at 20:50
1 Answers
0
You can use getTiedJobs() method of getComputer()
for (slave in hudson.model.Hudson.instance.slaves) {
println('Name: ' + slave.name);
println('TiedJobs: ' + slave.getComputer().getTiedJobs());
}
http://javadoc.jenkins.io/hudson/model/Computer.html#getTiedJobs()

Igor Zilberman
- 1,048
- 1
- 11
- 16