Reputation: 71
I have a requirement to fetch Script path from Jenkins Job .
Please find the below screenshot to understand the requirement more clearly.
I have checked in google to get some Groovy Console Script which lists details of each Job.
By using the jenkins.model.Jenkins.getJobNames() method ,i was able to get all Jobs in Jenkins , but actually the requirement is to get the Scriptpath value, mentioned inside each those jobs.
Which Jenkins Class/method can provide those details or is any other way to fetch those details using Jenkins API?
By reading the config.xml for each job and getting the Scriptpath tag from it will also give me the information needed, But I was looking for a REST method or Jenkins Groovy Script method which can give me this Script path Information for each Job.
Upvotes: 1
Views: 1720
Reputation: 13712
configure
at the end of url to config.xml
and press Enter<scriptPath>xxxxxx</scriptPath>
So you can send http requset to job's confim.xml url and parse the content to get the value programmatically
Upvotes: 2