PDF - Allow to export approval state / content

Description

Implement a new non-interactive step type PDF for the Approval Path definition.
When the approval reaches a PDF step, it generates a PDF snapshot of the approval state (and optionally the
referenced Jira issue / Confluence page), delivers it to configured channels, and resolves to SUCCESS or FAIL.

Available in both Jira and Confluence product modes. Multiple PDF steps per definition are allowed; placement is unconstrained.

Scope

  • New StepType.PDF enum value

  • New PdfApprovalStep (implements ApprovalStep, StepAcceptable) - same shape/semantics as AutomationApprovalStep, plus: name, headerText, content (PdfContentConfig), delivery
    (PdfDeliveryConfig), haltOnDeliveryFailure (default false)

  • StepVisitor.visit(PdfApprovalStep) added; existing visitors get no-op default

  • Persisted into the existing definition_config JSON column - no schema change

Content (PdfContentConfig)

  • Approval section (always included): name, status, progress, version, definition info, timestamps, full step list with per-step type/target/status/decision/comment, and rejection/success/expiration branches

  • Issue-or-page section (optional): fields: List<String> + comments: ALL | LAST_N | null

  • Jira: any system/custom field via existing field picker; rendering rules per field type (text, select, user, date, ADF→HTML)

  • Confluence: fixed set (labels, summary, content, creator, last-updated-date-time, created-date-time); page footer/inline comments

Delivery (PdfDeliveryConfig)

  • email: EmailDelivery | null — groups: Set<RecipientGroup> (ALL_APPROVERS, APPROVAL_CREATOR, ISSUE_REPORTER, ISSUE_WATCHERS, PAGE_CREATOR), freeFormAddresses, namedUsers. Single email per step run, recipients in BCC. Goes through existing EmailService / EmailTemplateCreator

  • attach: boolean - uploads PDF as Jira issue / Confluence page attachment. Filename: <approval-name-slug>-v<version>-<status>-<yyyyMMdd-HHmm>.pdf

  • Both can be enabled simultaneously

  • Generation failure → always FAIL. Delivery failure → FAIL if haltOnDeliveryFailure else SUCCESS with errors logged via existing instance_errors

UI

  • Definition editor: new step-config card (name, header, content toggles, field picker, comments mode, email + recipient sources, attach toggle, halt-on-failure toggle). Validation: at least one delivery channel; if email enabled, at least one recipient source

  • Approval view: step renders like other automated steps with status badge, timestamp, error, and attachment link when delivered

  • Instance errors: failed deliveries appear alongside webhook failures

Boundaries

  • New package ovh.atlasinc.ap.jira.pdf (PdfStepExecutor, PdfRenderingService, PdfDeliveryService, content gatherers)

  • New template templates/pdf/approval-export.ftl

  • Reuses ApprovalService / ApprovalPath, EmailService, existing host clients, instance_errors, automated-step execution pipeline

Constraints

  • Soft cap 25 MB rendered PDF (config property); over → FAIL with descriptive error

  • PDFs not persisted by the app (only errorMessage + attachment ID)

  • Renders in approval's locale / timezone

  • Warning banner in editor when free-form emails used with comments/rich content

Out of scope (v1)

  • Manual "Export to PDF" button on a live approval

  • Bulk PDF export from list view

  • Custom branding / template customization

  • PDF/A archival format

Open questions to confirm before implementation

  • Per-step email reply-to / from override (default: inherit from EmailService)

  • Are email-step "approvers" (address, no account) part of ALL_APPROVERS? (default: yes)