Class InteractiveViewStep

java.lang.Object
hudson.model.AbstractDescribableImpl<org.jenkinsci.plugins.workflow.steps.Step>
org.jenkinsci.plugins.workflow.steps.Step
io.jenkins.plugins.interactiveinput.step.InteractiveViewStep
All Implemented Interfaces:
ExtensionPoint, Describable<org.jenkinsci.plugins.workflow.steps.Step>, Serializable

public class InteractiveViewStep extends org.jenkinsci.plugins.workflow.steps.Step implements Serializable
The interactiveView pipeline step: snapshot a generated file into the plugin's durable store and publish a Confluence-style review page where humans can comment (generally or inline, per source line), edit a durable review copy (with version history) and record an approve / reject / acknowledge / request-changes decision.

 // non-blocking: publish for review and carry on (returns the review id)
 interactiveView(file: 'reports/summary.md', reportName: 'Build Summary', commentable: true)

 // blocking review gate: pause until a human decides, then branch on the outcome
 def r = interactiveView(file: 'reports/plan.md', wait: true, slaMinutes: 30)
 if (r.status == 'APPROVED') { echo "approved by ${r.decidedBy}" }

 // regenerate loop: feed the inline comments back to a generator on "Request changes"
 if (r.status == 'CHANGES_REQUESTED') {
     r.comments.each { c -> echo "line ${c.line}: ${c.body}" }  // pass to your AI agent
 }

 // folders / dynamically generated files: publish every match as one grouped report
 interactiveView(includes: 'reports/**' + '/*.md', reportName: 'Generated reports')
 interactiveView(dir: 'out/site', mode: 'info', notify: false)  // read-only viewer, no approval
 

The source is read via the build's FilePath workspace and copied into the store, so the review still works after the workspace/build is cleaned. Provide exactly one of: a single file; an Ant-style includes glob (optionally with excludes); or a dir (sugar for dir/**). A glob/dir publishes one review per matched file, grouped under a shared reportName. Markdown is rendered to safe HTML; every other format (HTML included, and any programming language) is shown as escaped, syntax-highlighted source — never executed.

mode is 'review' (default — a decision is required) or 'info' (a read-only viewer, still commentable, with no approve/reject buttons). wait:true requires a single file in 'review' mode.

Return value: a single-file, non-blocking call returns the review id (String); a glob/dir call returns a Map [groupId, ids, count]; wait:true returns a Map [id, status, decidedBy, version, content, comments] on decision (where comments is a list of [id, line, body, author, createdTs, resolved]; line is the 1-based source line for inline comments or -1 for general notes), or throws a TimeoutException on SLA expiry (like askInteractive).

See Also:
  • Constructor Details

    • InteractiveViewStep

      @DataBoundConstructor public InteractiveViewStep()
  • Method Details

    • getFile

      @CheckForNull public String getFile()
    • setFile

      @DataBoundSetter public void setFile(@CheckForNull String file)
    • getIncludes

      @CheckForNull public String getIncludes()
    • setIncludes

      @DataBoundSetter public void setIncludes(@CheckForNull String includes)
    • getExcludes

      @CheckForNull public String getExcludes()
    • setExcludes

      @DataBoundSetter public void setExcludes(@CheckForNull String excludes)
    • getDir

      @CheckForNull public String getDir()
    • setDir

      @DataBoundSetter public void setDir(@CheckForNull String dir)
    • getMode

      @CheckForNull public String getMode()
      Returns:
      the review mode as configured (review/info); null means default.
    • setMode

      @DataBoundSetter public void setMode(@CheckForNull String mode)
    • getTitle

      @CheckForNull public String getTitle()
    • setTitle

      @DataBoundSetter public void setTitle(@CheckForNull String title)
    • getReportName

      @CheckForNull public String getReportName()
    • setReportName

      @DataBoundSetter public void setReportName(@CheckForNull String reportName)
    • isCommentable

      public boolean isCommentable()
    • setCommentable

      @DataBoundSetter public void setCommentable(boolean commentable)
    • isEditable

      public boolean isEditable()
    • setEditable

      @DataBoundSetter public void setEditable(boolean editable)
    • isNotify

      public boolean isNotify()
    • setNotify

      @DataBoundSetter public void setNotify(boolean notify)
    • isWait

      public boolean isWait()
    • setWait

      @DataBoundSetter public void setWait(boolean wait)
    • getFormat

      @CheckForNull public String getFormat()
    • setFormat

      @DataBoundSetter public void setFormat(@CheckForNull String format)
    • getSlaMinutes

      public int getSlaMinutes()
    • setSlaMinutes

      @DataBoundSetter public void setSlaMinutes(int slaMinutes)
    • getSubmitterFilter

      @CheckForNull public String getSubmitterFilter()
    • setSubmitterFilter

      @DataBoundSetter public void setSubmitterFilter(@CheckForNull String submitterFilter)
    • resolveSlaMs

      public long resolveSlaMs()
      Returns:
      the effective SLA in milliseconds for a blocking review, resolving the JCasC default.
    • start

      public org.jenkinsci.plugins.workflow.steps.StepExecution start(org.jenkinsci.plugins.workflow.steps.StepContext context) throws Exception
      Specified by:
      start in class org.jenkinsci.plugins.workflow.steps.Step
      Throws:
      Exception