Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-73016

BuildCause doesn't work when actual cause is an instance of a child class

XMLWordPrintable

      I am using Gerrit Trigger plugin, which has GerritCause class which extends SCMTriggerCause. BUILD_CAUSE variable says "SCMTRIGGER" but the condition is not fulfilled.

      I've checked the source code and the change is easy to fix. In CauseCondition class replace String causeClassName to Class<? extends Cause> causeClass and than change isCausedBy() method to something like this:

      boolean isCausedBy(Cause cause) {
          return this.causeClass.isInstance(cause);
      } 

      It allows more plugins to be integrated with Run Conditon plugin without code interference.

            bap bap
            kayjayb33 Krzysztof
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: