Notification templates
This feature enables you to customize your notifications with dynamic content using OlivLang. You can personalize the sender details, subject, and message content (both text and HTML versions) for each template to better reflect your brand and communication style.
Customization Options
Activate/Deactivate Customization:
Turn on or off customization for each notification type.Editable Fields:
From: Define the sender's name and email (e.g., Sender Name <sender@example.com>).
Subject: Set the email subject line.
Text Message: Write or edit the plain text version.
HTML Message: Write or edit the rich text (HTML) version.
Restore Defaults:
Each field has an option to revert to its default value if you need to reset your changes.
Dynamic data placeholders
Your email templates can include dynamic placeholders that are automatically replaced when the email is sent:
Sender Information:
{{ senderEmail }}
User who started approval:
{{ approvalOriginator }}
Approval properties:
All approval fields can be found here in our API documentation.
Examples:{{ approval.name }}, {{ approval.status }}, {{ approval.steps }}
Web API docs containing all Approval fieldsIssue fields:
All issue properties can be found here in the Atlassian docs.
Examples:{{ issue.key }}, {{ issue.fields.summary }}, {{ issue.fields.project.key }}
Atlassian docs containing all IssueBean fields under Responses sectionLink to approval:
{{ approvalLink }}
Application name:
{{ appName }}
Optional fields:
{{ delegatorName }}
and{{ action }}
(approval/consent) if available
OlivLang
OlivLang is a templating language that allows you to add dynamic elements to your emails.
Template Structure
Literal text is emitted as-is.
Expression blocks evaluate a value and print it:
Hello {{ user.name }}
Statement blocks introduce control‐flow, loops, function & var declarations, but don’t auto-print their result:
{{ if (condition) }}…{{ end }} {{ for (var x of list) }}…{{ end }} {{ var total = a + b }}
Expressions & Data Access
Variables & property access
Simple variable:
{{ approval.name }}
Nested fields:
{{ issue.fields.summary }}
Map lookup by key:
{{ myMap.someKey }}
Operators
Category | Syntax | Notes |
---|---|---|
Arithmetic |
|
|
Comparison |
| Numeric comparisons |
Equality |
|
|
Logical |
| Short‑circuit; |
Defaulting |
| Returns |
Control Flow
Conditionals
{{ if (a == 1) }}
A is one
{{ else }}
{{ if (b == 2) }}
B is two
{{ else }}
Neither
{{ end }}
{{ end }}
Logical short-circuiting
Use and
/ or
for compound tests; both short-circuit:
{{ if (a == 1 or b == 2) }}
...
{{ end }}
{{ if x == "foo" and (y != "bar" or z > 5) }}
{{ // parentheses control evaluation order }}
{{ end }}
or
: returns first truthy operandand
: returns first falsy operand
Iteration
For-of Loop
Iterate arrays or iterables:
{{ for (var item of collection) }}
{{ index }}: {{ item }}
{{ end }}
Classic For Loop
Initializer; condition; increment:
{{ for (var i = 0; i < 5; i = i + 1) }}
{{ i }}
{{ end }}
Functions & Variables
Defining Functions (fun
)
Reusable subtemplates:
{{ fun bold(text) }}
**{{ text }}**
{{ end }}
Defines a named sub‐template you can call:
{{ bold("Hello") }}
Declaring Variables (var
)
Local bindings:
{{ var x = expression }}
Defaults & Fallbacks
Protect against null
or missing values:
Hello {{ user.name or "there" }}
If
user.name
isnull
or undefined, prints"there"
.
Comments
{{ // This is a comment – ignored by the engine }}
Anything after
//
inside an expression block is dropped.
Working with Jira Custom Fields
Jira’s issue.customFields
is an array of { id, value }
. Here is an example of looping through an array and filtering fields by ID:
{{ for (var cf of issue.customFields) }}
{{ if (cf.id == "customfield_10048"
or cf.id == "customfield_10024") }}
{{ cf.id }} - {{ cf.value }}
{{ end }}
{{ end }}
Example OlivLang code
{{ // Example helper method to display some basic step fields }}
{{ fun displayStep(step) }}
- Display name: {{ step.displayName }}
- Type: {{ step.type }}
- Status: {{ step.status }}
- Decision date: {{ step.decisionDate }}
{{ end }}
{{}}Hello, {{ approvalOriginator }}!
Sender: {{ senderEmail }}
Approval data:
Name: {{ approval.name }}
Status: {{ approval.status }}
Steps details:
{{ for (var step of approval.steps) }}
Step {{ index }}:
{{ displayStep(step) }}
{{ // Let's display more step fields conditionally }}
{{ if (step.type == "USER") }}
- User ID: {{ step.userId }}
{{ end }}
{{ end }}
Issue data:
Key: {{ issue.key }}
Summary: {{ issue.fields.summary }}
Project key: {{ issue.fields.project.key }}
{{ if (approval.status == "SUCCESS") }}
Approved
{{ else }}
{{ if (approval.status == "IN_PROGRESS") }}
In progress
{{ else }}
Rejected
{{ end }}
{{ end }}
{{ var pct = (approval.stepsDone / approval.stepsCount) * 100 }}
Approval progress: {{ pct }}%
Testing your templates
A dedicated testing area allows you to preview the rendered output of your templates. Simply select the field you want to test (From, Subject, Text Message, or HTML Message), supply the necessary context, and view the results. If an error occurs during rendering, an error message will guide you through troubleshooting.