YouTrack Standalone 7.0 Help

Custom Notifications Language Reference

Local Variables

Local variables can be used, but not changed by the user. Local variables are predefined and read-only.

Local Variable Type Description
header string Notification's header, short text identify the notification type (available values: created/updated/commented/voted/tagged, etc.). Variable is used in default email subject template.
from User Notification sender's info
to User Notification recipient's info
application.name string Evaluates to "YouTrack"
application.version string Evaluates to the current version
application.build string Evaluates to build number
reason string Evaluates to description of the reason a user receives notification. Description form differs in jabber and email notifications.
issue Issue Evaluates to an issue, about which notification is sent.
change IssueChange Contains info about changes (issue project, summary, description, custom fields, visibility group, links, attachments) that initiated notification.
comment Comment Evaluates to an edited or posted comment, about which notification is sent.
comment_updated boolean true - comment has been edited, false - new comment has been posted
tag Tag Evaluates to an tag, which has been added to or removed from an issue.
untag boolean indicator that issue has been tagged/untagged
unvote boolean indicates that issue has been voted/unvoted
project Project Imported project or project failed to import (id, full name, issues, leader...). Variable is used in the "Import status" notification.
exception Throwable Java Throwable object
message string text of the message in the "Import status" notification.

Directives

You use FTL tags to call directives. Besides build-in directives like the #list directive (Built-in directives), you can define your own directives in Freemarker. For more information, see (User-Defined directives manual).

  • wiki process embeded text using Wiki syntax and keywords. Directive apply html escaping.
    • parameter no parameters
    • body text to process

Example:

@wikisolidhtml <#escape x as x?html> ... <@wiki><#noescape>${comment.text}</#noescape></@wiki> ... </#escape x as x?html>
  • diff render html element presenting text change. Mark deleted and added sections of text with given styles.
    • parameters:
      • oldText old version of text
      • newText new version of text
      • insStyle html style of inserted parts of text
      • delStyle html style of deleted parts of text
    • body no body

Example:

@diffsolidhtml <@diff oldText=change.before.summary newText=change.after.summary insStyle="background-color: #E6FFE6;" delStyle="background-color: #FFE6E6;"/>
  • stacktrace render the html component representing stacktrace of Throwable
    • parameters:
      • throwable instance of Throwable Java class
    • body no body

Example:

@stacktracesolidhtml <div><pre><@stacktrace throwable=exception/></pre></div>

Utils

  • Everywhere the type of returned value is list<?>, you can iterate over method result using #list directive.
Method Summary
static string getAttachmentUrl(Attachment attachment)
returns URL of attachment resource
static string getAvatarUrl(User user)
returns URL of user avatar
static string getCommentReplyUrl(Comment comment)
returns URL of web page with Issue view focused on reply text area
static string getCommentUrl(Comment comment)
returns URL of web page with Issue view focused on comment
static list<ProjectCustomField> getCustomFields(Issue issue)
returns list of custom fields of issue
static Issue getDuplicate(Issue source)
returns issue duplicated by the source issue, if there is no such issue returns null
static string getEditProjectUrl(Project project)
returns URL of web page in Administration where you can edit project
static list<Tag> getExplicitTags(Issue issue)
returns list of tags of issue except tag 'Star' visible for notification recipient
static int getInvisibleAttachmentsCount(Issue issue)
returns number of issue's attachment invisible for notification recipient
static string getIssuesUrl(Project project)
returns URL of web page with issue list opened in context of project
static string getJiraIntegrationUrl()
returns URL of web page in Administration where you set up JIRA integration
static list<Issue> getLinkedIssues(Issue source, string linkRole)
linkRole name of link (Related, Duplicate e.t.c.)
returns list of issues linked with source by the link of specified role
static list<string> getLinkRoles(Issue source)
return all possible roles of links of source issue
static string getPossessiveName(User you, User from)
return "you" if you and from is the same user, and from user presentation otherwise
static string getResolveStatus(Issue issue)
return "resolved" if issue has been resolved and "" otherwise
static string getSettingUrl(User user)
return URL of web page with user profile setting focused on the "Filters and Notifications" tab
static string getStarSrc(Issue issue) return URL of 'Star' tag image resource
static string getTaggedIssuesUrl(Tag tag)
returns URL of web page with issue list opened in context of tagged by tag issues
static string getTrimmedTagName(Tag tag)
return tag name restricted by 25 chars length
static string getUrl(Issue issue)
returns URL of web page with issue
static list<Attachment> getVisibleAttachments(Issue issue)
return list of issue's attachments visible for notification recipient
static boolean hasLinks(Issue issue)
returns either issue has any links or not
static string inUserTimeZone(instant time)
returns human readable formatted time brought to the recipient time zone
static boolean isFixed(Issue issue)
returns either issue has been fixed or not

Last modified: 2 February 2017