Class CauseResolver

java.lang.Object
io.jenkins.plugins.interactiveinput.util.CauseResolver

public final class CauseResolver extends Object
Resolves a short, human-readable "who/what started this build" label for a Run, used to attribute interactive-input questions in the notification surfaces ("started by <user>").

Prefers a real Jenkins user id (Cause.UserIdCause); otherwise falls back to a stable label for common non-interactive triggers (SCM, timer, upstream) or "system".

  • Field Details

  • Method Details

    • isRealUser

      public static boolean isRealUser(@CheckForNull String startedBy)
      Parameters:
      startedBy - a value produced by startedBy(Run) (a user id or a trigger label)
      Returns:
      true if it denotes a real Jenkins user (i.e. a build a human started), rather than a non-interactive trigger label or null/blank. Used to decide whether a build has an "owner" for user-scoped notifications and lock-to-starter.
    • startedBy

      @NonNull public static String startedBy(@NonNull Run<?,?> run)
      Parameters:
      run - the build to attribute (must not be null)
      Returns:
      the triggering user id, or a trigger label (scm, timer, upstream), or SYSTEM. Never null or empty.