
Local variables can be used, but not changed by 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... e.t.c.). 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. |
h2. Directives
You use FTL tags to call directives. Besides build-in directives like the {{#list}} directive ([Built-in directives|http://freemarker.sourceforge.net/docs/ref_directives.html]), there is possibility to define directive yourself in Freemarker ([User-Defined directives manual|http://freemarker.sourceforge.net/docs/ref_directive_userDefined.html]).
* wiki -- process embeded text using Wiki syntax and keywords. Directive apply html escaping.
** parameter -- _no parameters_
** body -- text to process
Example:
{code:html|title=@wiki|borderStyle=solid}
<#escape x as x?html>
...
<@wiki><#noescape>${comment.text}</#noescape></@wiki>
...
</#escape x as x?html>
{code}
* 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:
{code:html|title=@diff|borderStyle=solid}
<@diff oldText=change.before.summary
newText=change.after.summary
insStyle="background-color: #E6FFE6;"
delStyle="background-color: #FFE6E6;"/>
{code}
* stacktrace -- render the html component representing stacktrace of Throwable
** parameters:
*** throwable -- instance of Throwable Java class
** body -- _no body_
Example:
{code:html|title=@stacktrace|borderStyle=solid}
<div><pre><@stacktrace throwable=exception/></pre></div>
{code}
h2. 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 setup 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|
{hidden-data}
h2. Classes
Any variable is actually a Java object to which you can invoke methods and get properties values like in object-oriented programming.
\*string
\*boolean
\*instant
\*int
\*null
\*User
\*Issue
\*IssueChange
\*Comment
\*Tag
\*Project
\*ProjectCustomField
{hidden-data}