Notification Template Language Reference
This reference lists the variables and helper APIs that are currently exposed to YouTrack notification templates.
The exact set of variables that you can use depends on the template that you edit. The Available Variables panel in the editor shows the variables that are supported for the current template.
Local Variables
Local variables can be used but not changed by the user. These variables are predefined and read-only.
Local Variable | Type | Description |
|---|---|---|
|
| The This variable is used in the default email subject template. |
|
| Represents the sender of the notification. |
|
| Represents the recipient of the notification. |
|
| Evaluates to |
|
| Evaluates to the current version. |
|
| Evaluates to the current build number. |
|
| Represents the issue that triggered the notification. |
|
| Represents the article that triggered the notification. This variable is available in article notifications. |
|
| Represents the change that triggered the notification. Use this variable to access the author, timestamps, and events that are included in a digest. |
|
| Contains multiple changes for cluster digest notifications. |
|
| Represents a posted or updated comment. |
|
| Indicates that the outgoing helpdesk comment was created from an email reply. This variable is used in helpdesk notification templates. |
|
| Represents the tag that triggered the notification. |
|
| Represents the root issue in duplicate cluster notifications. |
|
| Indicates that a notification was generated in the context of duplicate clustering. |
|
| Indicates that the recipient is receiving the first notification in the current thread. |
|
| Indicates that the recipient is losing access to the issue or article after this notification, so this is the last notification they can receive for that thread. |
|
| Describes why the recipient received the notification, including saved searches, mentions, tags, reactions, ticket reasons, and duplicate-cluster reasons. |
|
| Represents the imported project, or the project that failed to import. This variable is used in the "Import status" notification. |
|
| Represents a Java |
|
| Contains the message text in the "Import status" notification. |
|
| Exposes the markup renderer in templates that provide the markup model. |
|
| Represents the event adapter in templates that work with a single notification event. |
|
| Provides the command list in templates related to command execution. |
|
| Provides a URL value for templates that pass the target location as a top-level variable. |
|
| Provides the notification subject text when it is exposed as a top-level variable. |
|
| Provides the rendered HTML body in templates that work with generated notification content. |
|
| Provides the rendered plain-text body in templates that work with generated notification content. |
|
| Represents the integration configuration entity in integration-specific templates. |
|
| Contains the integration context parameters that are passed to integration-specific templates. |
|
| Provides the thread subject when the notification channel tracks a conversation thread. |
|
| Identifies the notification channel for templates that support multiple delivery channels. |
Type Reference
This reference lists the members that are explicitly exposed by the current notification template adapters in YouTrack.
Issue
The Issue type combines standard issue data with notification-specific helper members.
To print the issue ID, use
${issue.id}.To link to the issue, use
<a href="${issue.url}">${issue.id}</a>.
Older templates may use ${issue.getId()} or ${Utils.getUrl(issue)} for the same result.
Member | Description |
|---|---|
| The issue ID. |
| Indicates whether the recipient has starred the issue. |
| Indicates whether the issue is resolved. |
| The attachments that are visible to the recipient. |
| The number of attachments that are hidden from the recipient. |
| The comments that are visible to the recipient. |
| The tags that are visible to the recipient. |
| The link roles that are available for the issue. |
| The custom fields that are visible to the recipient. |
| The absolute URL for the issue. |
| Returns issues that are linked with the specified role. |
| Returns a property value by name. This can be used to access standard issue fields like |
Comment
Member | Description |
|---|---|
| The internal ID of the comment. |
| The user who wrote the comment. |
| The comment text. |
| The absolute URL for the comment. |
| The creation timestamp. |
| The last update timestamp. |
| The attachments that are visible to the recipient. |
Article
Member | Description |
|---|---|
| The article ID. |
| The project that contains the article. |
| The author of the article. |
| The article title. |
| The article body. |
| The absolute URL for the article. |
Change
Member | Description |
|---|---|
| The identifier of the change. |
| The user who applied the change. |
| The start of the merge interval. |
| The end of the merge interval. |
| The event adapters that describe the visible changes. |
| A human-readable representation of the change time. |
| Checks whether the change contains an event in the specified category. |
| Checks whether the change contains any visible events. |
Field
Member | Description |
|---|---|
| The field name. |
| The rendered field value. |
| The background color that is associated with the field value. |
| The foreground color that is associated with the field value. |
| Indicates whether the field supports multiple values. |
| Indicates whether the field is visible to the recipient. |
| Indicates whether the field stores markup text. |
| The field type name. |
| Checks whether the field is shown for the specified issue. |
Reason
Member | Description |
|---|---|
| The saved search rules that matched the notification. |
| The tag-based rules that matched the notification. |
| The mention-based reasons that matched the notification. |
| The duplicate cluster reason, when present. |
| The helpdesk reason, when present. |
| The reaction-based reasons that matched the notification. |
| The helpdesk ticket reasons that matched the notification. |
| A flattened list of the applicable reasons. |
Each item in the reason collections exposes the following members: name, type, issueId, underlyingEntityId, underlyingEntity, mask, and debugInfo.
Directives
You use FTL tags to call directives. Besides built-in directives like the #list directive, you can define your own directives in Freemarker. For more information, see the User-Defined directives manual.
markup
markup processes embedded text using the YouTrack markup renderer for the current issue context.
Parameter | None |
|---|---|
Body | Text to process. |
Example:
l10n
l10n renders the body without additional parameters. Use this directive for localized template fragments.
Parameter | None |
|---|---|
Body | Text to render. |
diff
diff renders an HTML element that highlights changes applied to text. Deleted and added sections of text are marked with different styles.
Parameters |
|
|---|---|
Body | None |
Parameter details:
oldTextis the old version of the text.newTextis the new version of the text.insStyleis the HTML style for inserted text.delStyleis the HTML style for deleted text.
Example:
stacktrace
stacktrace renders the HTML component that represents the stack trace of a Throwable.
Parameter |
|
|---|---|
Body | None |
Example:
Utils
The Utils object exposes helper methods that you can call from notification templates when a value is not available directly as an object property, or when you need a formatted URL or presentation helper.
When the type assigned to a returned value is
list<?>, you can iterate over the result using the#listdirective.The helper methods in this section are exposed as static methods of the
Utilsobject.
Method | Description |
|---|---|
| Returns the URL for the specified attachment resource. |
| Returns the URL for the specified user's avatar. |
| Returns the URL of the issue view with focus on the reply text area for the specified comment. |
| Returns the URL of the issue view with focus on the specified comment. |
| Returns the issue marked as a duplicate of the source issue, or |
| Returns the URL of the built-in icon resource with the specified name. |
| Returns the tags that are visible for the notification recipient, excluding the |
| Returns the number of issue attachments that are not visible to the notification recipient. |
| Returns the issues that are linked to the source issue with the specified link role, such as Relates or Duplicate. |
| Returns all available link roles for the source issue. |
| Returns |
| Returns an unsubscribe URL for the specified user and issue. |
| Returns the URL of the specified user's YouTrack profile with focus on the Notifications tab. |
| Returns the URL of the image resource for the Star tag. |
| Returns the URL of the Issues list filtered by the specified tag. |
| Returns an inline CSS style string for the specified tag. |
| Returns the name of the specified tag, limited to the first 25 characters. |
| Returns the URL of the specified issue. |
| Returns a human-readable description of the visibility restrictions for the specified entity. |
| Checks whether the specified issue has any links. |
| Checks whether the specified entities have the same visibility restrictions. |
| Checks whether the specified entity has visibility restrictions. |
| Returns the specified time in a human-readable format that is converted to the message recipient's local time zone. |