Thanks Sverre Moe, you made my day !

Here is the final version of the code snippet. 
 

> import jenkins.branch.BranchIndexingCause
>
>     final def jenkinsInstance = jenkins.model.Jenkins.getInstance()
>     final def jenkinsProject = jenkinsInstance.getItemByFullName(
> jenkinsProjectName)
>     if (jenkinsProject != null) {
>         final def job = jenkinsProject.getAllJobs().first()
>         final def lastBuild = job.getLastBuild()
>         final def causes = lastBuild.getCauses()
>         final def buildCause = causes.first()
>         if (buildCause instanceof BranchIndexingCause) {
>
>         }
>     }
>

/Ram

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/de24c1bf-16b2-49fa-a566-9e37fd7936fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to