Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import jenkins.model.Jenkins
  2. import hudson.model.*
  3.  
  4. def is_triggered_by_scm_change(build) {
  5. for (action in build.actions){
  6. if (action instanceof CauseAction){
  7. if (action.getCauses().any { cause -> cause.getShortDescription().contains("Started by an SCM change") }){
  8. return true
  9. }
  10. }
  11. }
  12. return false
  13. }
  14.  
  15. for(item in Hudson.instance.items) {
  16. if (is_triggered_by_scm_change(item.getLastBuild())){
  17. println(item.name)
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement