Delivery Mechanisms

The reporting service supports two delivery paths. Streaming delivery (streamResult=true on GET /rest/v1/reports/{reportId}) generates a password-protected ZIP file, uploads it to S3, and notifies the recipient with a download link. State report delivery (via the state-report queue) sends result sets or individual rows directly to the configured channel.

Streaming Delivery (S3-backed)

When a caller sets streamResult=true, the service executes the report in the background, packages the output as a password-protected ZIP, uploads it to S3, and delivers a notification containing the download URL and password.

S3 configuration

PropertyDefaultDescription
reportstreamer.s3bucket.namereporting-svc-publicS3 bucket name. Overridden at runtime by the UK_ENVIRONMENT or JG_ENVIRONMENT system variable when set (formatted as <env>-reporting-svc-public).
reportstreamer.s3bucket.expiry.days1Number of days before the S3 object expires and the download link becomes invalid.
reportstreamer.s3bucketsuffix.tenantdate.allowedfalseWhen true, the bucket name is derived per-tenant and per-date (reporting-svc-<tenantId>-<yyyyMMdd>) instead of the shared bucket.
aws.s3.url.bucket.suffixs3-eu-west-1.amazonaws.comDomain suffix used when constructing the public download URL.

Email notification templates

The streaming delivery path sends two email templates via the SMTP config — one for success and one for failure.

PropertyDescription
mustache.email.s3bucket.detailsMustache template property name for the success notification email. The template receives reportUrl, password, reportId, tenantName, to, and linkExpiryDays.
mustache.email.s3bucket.notification.failureMustache template property name for the failure notification email. The template receives errorMsg.

Streaming delivery mechanism types

The deliveryMechanismType query parameter on GET /rest/v1/reports/{reportId} controls how the S3 link is sent.

TypedeliveryMechanismValueBehaviour
emailRecipient email addressSends the Mustache success/failure template via SMTP. Requires SMTP config (see below).
httpCallback URLPOSTs a JSON body to the URL containing reportUrl, password, reportId, and linkExpiryDays. On error, posts errorMsg instead.
jiraJira config JSON (optional)Creates a Jira ticket. If deliveryMechanismValue is a JSON object, it takes precedence over the global reporting.service.jira.config property.

State Report Delivery

State reports are delivered via the state-report distributed queue or local-state-report local queue. Each message carries a Config field containing a JSON object that specifies the delivery mechanism and its parameters.

Result-set delivery (ResultSet)

Applies when the message contains a full result set. Supported mechanism types:

TypeDescription
emailSends the result set as an email attachment (XLSX or PDF).
sftpUploads the result set as a CSV to an SFTP server.
httpPOSTs the result set rows as a JSON array to a URL.
jiraCreates a Jira ticket with the result set attached as XLSX.
sftp-to-emailDownloads a file from SFTP and emails it as an attachment.
split-data-and-emailSplits the result set by a key column and sends a separate email per group.

Per-row delivery (ResultRow)

Applies when the message contains a single row. Supported mechanism types:

TypeDescription
emailSends a Mustache-templated email, optionally with a PDF attachment.
httpPOSTs the row as JSON to a URL.
jiraCreates a Jira ticket with the row data.
smsSends a Mustache-templated SMS using the smsTemplate field from the row data.
auditRaises a domain event using the eventType from the config.

SMTP Configuration

Required for all email delivery across both paths.

The SMTP config is stored as a JSON sub-property under the key reporting.service.smtp.config.

Sub-keyDescription
smtphostSMTP server hostname
smtpportSMTP server port
smtpuserSMTP authentication username
smtppassSMTP authentication password
fromSender address used on all outbound emails

Example property value:

{
  "smtphost": "smtp.example.com",
  "smtpport": 587,
  "smtpuser": "[email protected]",
  "smtppass": "s3cr3t",
  "from": "[email protected]"
}

Jira Configuration

Required for jira delivery. Stored as a JSON sub-property under reporting.service.jira.config. Per-report overrides can be passed inline as the deliveryMechanismValue JSON object.

Sub-keyDefaultDescription
baseUrlJira instance base URL
usernameJira account username
tokenJira API token
projectKeyREPOJira project key for new tickets
issueTypeREG-32Jira issue type ID
assignToJiraIdJira account ID to assign new tickets to
parentIdParent issue or epic ID to attach new tickets under

The Jira issue description is rendered from the template named by property handlebar.template.report.jira.issue.creation.notification.


SFTP Configuration

SFTP delivery does not use a global config property. Each state report config JSON references a named SFTP service by its sftpServiceIdentifier.

State report config fields for SFTP upload

FieldDescription
sftpServiceIdentifierName of the SFTP service connection to use
fileNameOutput filename. Supports {date} and {time} tokens.
uploadDirRemote directory path to upload the file to
dateFormatDate format pattern for {date} token (default: yyyy-MM-dd)
timeFormatTime format pattern for {time} token (default: HH-mm-ss)
skipHeadertrue to omit the CSV column header row

State report config fields for SFTP-to-email

FieldDescription
sftpServiceIdentifierName of the SFTP service connection to use
sourceFileNameRemote filename to download. Supports {date} and {time} tokens.
sourceDirRemote directory containing the file
destinationLocal path to write the downloaded file (default: /tmp/<sourceFileName>)
intervalInSecOptional offset in seconds applied to the current time when resolving date/time tokens

Email Attachment Configuration (State Reports)

The following fields in the state report config JSON control attachment behaviour when using email delivery for result sets.

FieldDefaultDescription
attachmentTypexlsxAttachment format: xlsx or pdf
attachmentNameFilename for the attachment. Supports {date} and {time} tokens.
dateFormatyyyy-MM-ddDate format for {date} token in attachmentName
timeFormatHH-mm-ssTime format for {time} token in attachmentName
sheetNameExcel sheet name (xlsx only)
skipHeaderfalsetrue to omit column headers from the attachment
passwordProtectAttachmentfalsetrue to ZIP-encrypt the attachment with a generated password
passwordLength10Character length of the generated password when passwordProtectAttachment is true
passwordFileNameFilename for the password file included as a second attachment
zipAttachmentfalsetrue to ZIP the attachment without password protection
includeAttachmentHashfalsetrue to include a hash.txt attachment containing the SHA256 of the attachment
toComma-delimited recipient addresses
ccComma-delimited CC addresses
bccComma-delimited BCC addresses
subjectEmail subject line
bodyEmail body text

Split-data-and-email

FieldDescription
tenantWiseSeparationKeyColumn name in the result set used to group rows into separate emails
emailAddressHeaderKeyColumn name containing comma-delimited recipient addresses for each group

HTTP Delivery Configuration (State Reports)

FieldDescription
urlTarget endpoint URL
authorizationHeaderStatic value for the Authorization request header
callAsSystemtrue to authenticate the request using the platform system user JWT instead of a static header
decryptPanFieldName of a field in the row data containing an encrypted PAN that should be decrypted before sending

Audit Delivery Configuration (State Reports)

FieldDescription
eventTypeRequired. The domain event type string raised for each row.