Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import jenkins.model.Jenkins
- import hudson.model.*
- def is_triggered_by_scm_change(build) {
- for (action in build.actions){
- if (action instanceof CauseAction){
- if (action.getCauses().any { cause -> cause.getShortDescription().contains("Started by an SCM change") }){
- return true
- }
- }
- }
- return false
- }
- for(item in Hudson.instance.items) {
- if (is_triggered_by_scm_change(item.getLastBuild())){
- println(item.name)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement