Class Incident

java.lang.Object
io.jenkins.plugins.batchcontrol.model.Incident

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class Incident extends Object
An automatically registered error case (SPEC items 11 and section 3): opened for every build whose result is in the configured incidentResults, then handled by people (OPEN -> ACKNOWLEDGED -> RESOLVED).

Persisted as XStream XML at incidents/<id>.xml with a monthly JSONL index at incidents/index/YYYY-MM.jsonl (ARCHITECTURE section 5). Timestamps are stored as epoch milliseconds; the accessors expose Instant.

Status transitions must only be performed by ops.IncidentService; other code must not call setStatus(io.jenkins.plugins.batchcontrol.model.IncidentStatus). The stored parameters and logTail are already masked (D-19); the plaintext of a sensitive parameter never reaches this object.

  • Constructor Details

  • Method Details

    • getId

      public String getId()
    • getRunId

      public String getRunId()
    • getJobFullName

      public String getJobFullName()
    • getResult

      public String getResult()
    • getStatus

      public IncidentStatus getStatus()
    • setStatus

      public void setStatus(IncidentStatus status)
      Only ops.IncidentService may transition the status.
    • getTransitions

      public List<IncidentTransition> getTransitions()
      A defensive copy of the handling history, in append order.
    • addTransition

      public void addTransition(IncidentTransition transition)
    • getLogTail

      public List<String> getLogTail()
      The masked console log excerpt (at most 100 lines, D-19).
    • setLogTail

      public void setLogTail(List<String> logTail)
    • getRerunRequestIds

      public List<String> getRerunRequestIds()
    • addRerunRequestId

      public void addRerunRequestId(String requestId)
    • getResolvedByRunId

      public String getResolvedByRunId()
    • setResolvedByRunId

      public void setResolvedByRunId(String resolvedByRunId)
    • getParameters

      public Map<String,String> getParameters()
      The failed build's parameters, sensitive values already masked.
    • setParameters

      public void setParameters(Map<String,String> parameters)
    • getCreatedAt

      public Instant getCreatedAt()
    • getRunTimestampMillis

      public Long getRunTimestampMillis()
      D-72b (6): the failed build's own timestamp in epoch milliseconds, or null when the incident was stored before it was recorded.
    • setRunTimestampMillis

      public void setRunTimestampMillis(Long runTimestampMillis)
      Only ops.IncidentService records the failed build's timestamp, when it opens the incident.