The migration runbook covers building the notification scheme and templates in sequence (outbound side). The way a missing recipient setting silently stops mail is in the silent-failures post. This one is about what goes in the templates and notifications once mail is flowing.
Email This Issue Cloud's templates are Apache Velocity, and a few of their rules are not obvious: the notification's Subject field does nothing unless the template asks for it, a bare variable can print its own name to a customer, and one toggle decides whether a customer gets their own reply echoed back. This is the template and notification guidance I would want in front of me before building them.
Scope note. Most of this is vendor-documented, and I give the Appfire or Apache behaviour each time. My own first-hand input is thin: one observation that is consistent with the notification's Subject field being plain text, which I did not record as a controlled test, so I treat it as an inference. Where something is inferred and not stated by the vendor, I say so, and the last section lists the lot.
Velocity References: $x, ${x} and $!x
Apache Velocity's documented behaviour, which Email This Issue Cloud's own examples rely on:
| Syntax | Name | Value exists | Null or undefined |
|---|---|---|---|
$issue.summary | Shorthand | Renders the value | Renders the literal text $issue.summary |
${issue.summary} | Formal | Renders the value | Renders the literal text ${issue.summary} |
$!issue.summary | Quiet | Renders the value | Renders an empty string |
$!{issue.summary} | Quiet and formal | Renders the value | Renders an empty string |
Two points that people merge. The formal notation ${} only removes ambiguity about where a name ends, as in ${issue.key}-reply. It does not change how nulls behave. The quiet notation $! only suppresses null output. Do not confuse $!{foo}, a quiet reference, with !${foo}, which is a boolean NOT.
Does $! behave as expected in Email This Issue Cloud? On the documentary evidence, yes. Every Cloud example in Appfire's documentation uses it, and the Cloud API page says to render attributes in the format $!variable.attribute. Appfire does not say whether the engine runs in Velocity's strict mode, where rendering a null reference without $! throws an exception. Its own default templates would throw on empty fields in strict mode, so non-strict is the only consistent reading. I would confirm it once, using the template Test operation on an issue with an empty optional field.
What I would do: use $! for every output reference in the subject, HTML and text. Use $!{...} only where text immediately follows. Use plain references inside directives, such as #if($issue.assignee). Never ship a bare $ output reference, because a missing field then prints $issue.assignee.displayName to a customer.
Getting the Issue Key into the Subject
Two fields feed the subject, and the template is the one in charge.
- The template's Subject Template generates the final subject of mail sent with that template, and it “can contain static text and dynamic content, such as issue fields and custom fields.”
- The notification's Subject field is text to be added. The documentation says the
$!mailSubjectvariable “is replaced by the subject you enter in the Email Notification Schemes or Workflow Post Function.”
So if the template's Subject Template does not contain $!mailSubject, whatever you typed in the notification's Subject field never appears. Manual emails differ, because the subject typed on the Email screen “is not modified further by the email templates when the email is sent.”
Is the notification's Subject field itself evaluated as Velocity? Appfire's Cloud documentation does not say. Where fields are evaluated, they are labelled: the Advanced Email Configuration's Sender Name, From and Reply-To patterns are each described as Velocity-enabled, while the notification Subject is only described as text to be added. I treat it as plain text inserted verbatim into $!mailSubject. That is an inference. The design conclusion holds either way: put all tokens in the template's Subject Template, and use the notification Subject for static wording only.
A Subject Template that does the job:
[$!issue.key] $!issue.summary - $!mailSubject
To avoid a dangling hyphen when the notification Subject is blank:
[$!issue.key] $!issue.summary#if($mailSubject && $mailSubject != "") - $!mailSubject#end
Variable names
| Need | Cloud reference | Status |
|---|---|---|
| Issue key | $!issue.key | Documented (“Unique Issue Key”) |
| Summary | $!issue.summary | Documented |
| Status | $!issue.status.name | Status documented as an object; .name inferred |
| Type, project | $!issue.issueType.name, $!issue.project.name | Objects documented; $!issue.project.name appears in Appfire's Sender Name example |
| Triggering user | $!currentUser.displayName | Documented |
| Reporter, assignee | $!issue.reporter.displayName, $!issue.assignee.displayName | Follows the documented user pattern; not individually confirmed |
| Custom field, rendered | #renderCustomField($!issue, 'customfield_10603') | Documented macro |
| Custom field, raw | $issue.getCustomFieldValue('customfield_12345').value | Documented example |
| Request type | #renderCustomField($!issue, 'customfield_NNNNN') with your Customer Request Type field ID | Inferred. Get the ID from the Field Picker |
The Server and Data Center product exposes Jira's Java objects and a different macro library, plus features Cloud lacks. Appfire's migration guide tells you to check the available macros on Cloud, so do not paste Server snippets in untested. The editor's Field Picker inserts the exact code for any field and is the authoritative source of names on your own site.
Why the key matters more than it looks
Cloud lookups run in a fixed order: issue key, then headers, then JQL. Key lookup extracts the key from the message subject, is “always active,” and is not confined to any project: the documentation says it “will always search your entire Jira instance.” It tries each key-like string in turn and stops the chain at the first unambiguous match.
With header lookup turned off, the subject key is the only reply-threading mechanism you have. Drop it from a template and every customer reply becomes a new ticket. Two consequences follow from the same fact:
- Cross-project matching. A customer replying to a notification from a different project (“[OPS-123] …”) into this mailbox is appended to OPS-123.
- Accidental keys. A subject containing “ISO-9001” is tested as a key. If a project with that key exists, the mail can attach to an unrelated issue.
The fix for both is a condition in the handler's rule tree, not anything in the template. Guard the “issue exists” branch with an Issue matches query condition, for example project = HD, and route other matches to an ELSE. That is covered in the rule tree post.
Putting the Comment in a Customer Notification
Add current comment to email body is a Cloud notification option. Appfire's whole documentation of it is: “If enabled, and there's a comment, it is added to the email body.” It does not say which events qualify, how the comment is rendered, or whether it respects internal versus public visibility. I would treat it as rendering the triggering event's comment, and I would not rely on it to filter internal comments.
The template macros are more explicit:
| Mechanism | What the documentation says it renders | Visibility |
|---|---|---|
#renderComment() with $comment | The comment the user enters during the operation | No filter |
#renderLastComment($!issue) | The last comment on the issue | No documented filter |
#renderComments($!issue.comments) | “Renders the public comments” | Public only |
#renderAllComments($!issue.comments) | “Renders all comments (both public and internal)” | Dangerous in a customer template |
#renderIssueComments("desc" "1" "public") | Latest public comment; takes an order, a count (or “all”) and a public/internal restriction | Explicit public filter, the safest of the set |
The Issue Commented theme is the sensible starting point for a notification on events that contain comments, such as an issue being commented or a transition being executed. The other themes are All Details, Issue Updated, Work Logged, Issues list and Empty.
Keep internal notes internal
- Event first. Scope the customer comment notification to the Service Management public comment added event, not the generic Issue Commented event, which also fires for internal comments.
- Template second. Use
#renderIssueComments("desc" "1" "public")so a notification mis-scoped later still cannot leak an internal note. - Attachments. Appfire says that if a notification contains rendered comments, attachments in those comments are added to the email regardless of the attachment policy selected. Enable the policy option so attachments added in internal comments are not included.
- Handler comments. Keep customer replies added by the mail handler at All Users visibility.
Stopping Comment Echoes with Include Own Changes
Appfire's description, for Cloud: if the current user is a recipient, enabling Include own changes sends them a notification even if their profile setting says not to. “If the Include own changes toggle is disabled, no notification will be sent to the user triggering the action (regardless of their profile setting).”
It works the same way for every event: it decides whether the triggering user is dropped from the recipients. On a comment that the mail handler creates, the triggering user is the resolved sender, who is the customer. ON echoes their own reply back to them. OFF excludes only them, and other recipients still receive it. Nothing is “broken” unless the customer was the sole recipient, in which case no email is exactly what you want.
The way to get “created includes own changes, comment does not” is that the toggle lives on each Email Notification (Additional Settings tab), not on the scheme. There is also an Event's trigger setting on the notification's Scope (WHEN) tab: created events can be limited to “Jira web interface/Customer portal” or “Mail handler,” and commented events to “Jira web interface,” “Manual email” or “Mail handler.” That gives a pattern like this:
| Notification | Events | Event's trigger | Recipients | Include Own Changes | Template |
|---|---|---|---|---|---|
| A. Customer acknowledgement | Issue Created | Customer portal and Mail handler | Reporter | ON (the reporter is the triggering user) | Created template with the key in the subject |
| B. Agent reply to customer | Service Management Public Comment Added | Jira web interface only | Reporter, Request Participants | OFF | Issue Commented-based, public-filtered macro |
| C. Customer replied (agent alert) | Issue Commented or Public Comment Added | Mail handler | Assignee or project role | OFF | Short internal template |
B never fires for a customer's email reply, because of the trigger filter, and Include Own Changes OFF is a second guard if someone re-ticks “Mail handler.” There is an edge case. If a reply runs as the Default Reporter, because the sender is unknown, the triggering user is the Default Reporter, so only the trigger filter protects the customer. Keep both controls.
Notification A is why Include Own Changes must stay ON for creation: with it off and the reporter as the only recipient, the acknowledgement is dropped, as the silent-failures post describes. I found no published community consensus on the echo problem. This pattern is built from Appfire's documented controls, not copied from anyone's tested setup.
Is Send auto-reply a better acknowledgement?
Not in my case.
- It covers only requests created by email. Notification A covers portal requests as well, with one template.
- Appfire: “By default the sender of the auto reply emails will be the default reporter.” You can override the From address and name, but “the SMTP server must accept the specified From Address as a valid sender,” which is one more identity to scope.
- Inside an auto-reply,
$!mailSubjectis the subject of the original email and$!mailBodyits original body. That is a different template contract.
If you ever switch, put it last inside IF issue is NOT found, never at the top level, and untick “Mail handler” on notification A.
Editors, Testing and a Few Macros
- Where. Outgoing Mails tab, Email Content, Templates. Add, then choose a theme; the three-dot menu offers Edit, Copy, Test and Delete. The Category field groups templates, and some categories are special, such as canned responses.
- Editors. A WYSIWYG HTML editor with Preview and full screen, a raw HTML editor, and a Text Template.
- Preview versus Test. Preview checks layout in the editor. Appfire calls Test “the best way to validate whether a template is correct”: it takes an issue key and sends a real email to you only. I found no Cloud documentation of a keyboard shortcut for preview, so rely on the Preview button.
- Testing safely. Test against a real key, or against a test issue whose reporter is a mailbox you control. Template rendering failures show up in the Outgoing Error Queue, which Appfire describes as holding “errors in the app, like templates that prevent the generation of emails.”
- Useful macros.
#renderLinkToPortalRequest("View request"),#renderLinkToPortal("Customer portal"), and#renderDateTime($!issue.created "dd MMM yyyy HH:mm" "Europe/London"). Embed images withdata-embed="true"on the<img>tag. - Assets. The Assets macros render all attributes, including hidden ones, unless you pass an attribute list.
What Is Documented, Inferred, or Unverified
Observed myself, loosely: one observation consistent with the notification Subject being plain text, not recorded as a controlled test.
Documented by the vendor: Velocity reference behaviour; $!mailSubject; the Subject Template; the comment macros; Include Own Changes and its Additional Settings location; the Event's trigger options; the key lookup order and its site-wide scope; the Preview and Test behaviour; the auto-reply From address and Default Reporter behaviour.
Inferred, not stated by Appfire: that the notification Subject is plain text and not evaluated; that the engine runs non-strict; the .name and .displayName attribute names; the request type reference; what “Add current comment to email body” does with internal comments.
Not tested: the A, B and C notification pattern as a whole. It follows the documented controls, but I have not run all three together.
Closing Thoughts
Three habits cover most of it. Put every token in the template, because it is the only thing that decides the subject. Use $! everywhere you print, so a missing field is blank, not a variable name. And scope customer notifications twice, by event and by trigger, with Include Own Changes set per notification, so a mistake in one place does not echo a customer's own words back or leak an internal note.
← All guides