Class OpenInteractiveInputNote

java.lang.Object
hudson.console.ConsoleNote
hudson.console.HyperlinkNote
io.jenkins.plugins.interactiveinput.step.OpenInteractiveInputNote
All Implemented Interfaces:
ExtensionPoint, Describable, Serializable

public class OpenInteractiveInputNote extends HyperlinkNote
A console hyperlink that opens a specific interactive-input question's dialog in place on the page that shows the link (B6). On the build's Console Output the shared client (bell.js) intercepts the click and opens the shared native dialog right there, instead of first navigating to the per-build audit page (which then had to auto-open it — an extra hop the reviewer flagged).

It extends HyperlinkNote so the href resolution (context-path aware) and the console-note security envelope (core signs notes; only controller-written notes are honoured on render) are core's. We only contribute, via the extraAttributes() hook core provides for exactly this purpose, the two attributes the client needs:

  • data-ii-open — the question id to open;
  • data-root-url — the context path, so the REST call resolves under any context path even when this link is the only interactive-input surface on the page (mirrors the build-history badge's data-root-url).

The href stays a real deep-link (.../interactive-input/?open=<id>), so the link still works with JavaScript disabled or on a page where bell.js is not loaded: it then navigates to the audit page, which auto-opens the same dialog. No user-supplied text is emitted — the id is a server-generated UUID and the context path is Jenkins' own — so there is no injection surface beyond what HyperlinkNote already renders.

See Also:
  • Constructor Details

    • OpenInteractiveInputNote

      public OpenInteractiveInputNote(@NonNull String url, @NonNull String questionId, int length)
  • Method Details

    • encodeTo

      @NonNull public static String encodeTo(@NonNull String url, @NonNull String questionId, @NonNull String text)
      Returns:
      the console string that renders text as an in-place "open this question" link; falls back to the plain text if the note cannot be serialised (never breaks the build log).
    • extraAttributes

      protected String extraAttributes()
      Overrides:
      extraAttributes in class HyperlinkNote