The uploaded template file must be XHTML or DOCX Docx file. The template Template supports inline CSS and all markup attributes. See the samples for The sample you may download here: html and docx provided.
You can use predefined variables as as ${varname} in your templates. See the sample for variables used. The plugin supports the following variables:
...
Variable name
...
$affectVersions
...
Central interface to provide configuration for an application.
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Fields inherited from class com.atlassian.Jira.ofbiz. See AbstractOfBizValueWrapper for more information.
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Current attachment filenames
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Users can access Jira applications through this URL
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
$created
...
$components
...
$comments
...
Is used to retrieve and create comments
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
This is used to add, update, retrieve, and delete properties from сomments
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Time when the current ticket was created
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
$currentUser
...
Instance of com.atlassian.jira.datetime.DateTimeFormatter. By default, the Jira default style at invocation time is used. To specify a custom format, use the .withStyle(String style) method.
Code Block | ||
---|---|---|
| ||
$dateFormatter.withStyle("EEE, MMM d, ''yy").format($issue.getUpdated()) |
...
Formatter for printing and parsing date-time objects
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
$due
...
$encoder
...
in template. Following variables are supported:
- $issue - a current issue object com.atlassian.jira.issue.Issue
- $status - a status object of issue. Get the text of the status with: <p>$status.getSimpleStatus().getName()</p>
- $summary - a current issue summary
- $description - a current issue description
- $assignee - a current issue formatted assignee
- $reporter - a current issue formatted reporter
- $env - a current issue environment
- $created - a current issue formatted creation time
- $updated - a current issue formatted update time
- $due - a current issue formatted due date
- $nowDate - a current formatted date
- $nowTime - a current formatted timestamp
- $labels - a current issue collection of labels as array
- $fieldRenderer.renderField("<name>") - a current issue custom field value, where <name> is custom field name
- $fieldRenderer.renderField("<name>", "<default_value>")
...
- - a current issue custom field value, where
...
- <name>
...
- is custom field name
...
- .
...
- If
...
- value is
...
- NULL
...
- then
...
- <default_value> will render
- $fieldRenderer.renderFieldById("<id_num>") - a current issue custom field value, where <id> is custom field id (only numbers)
- $fieldRenderer.renderFieldById("<id_num>", "<default_value>")
...
- - a current issue custom field value, where
...
- <id>
...
- is custom field id (only numbers)
...
- .
...
- If
...
- value is
...
- NULL
...
- then
...
- <default_value> will render
...
$fieldRenderer.renderWiki2Html
...
Use wiki formats that will be rendered to PDF.
Code Block | ||
---|---|---|
| ||
$fieldRenderer.renderWiki2Html($description) |
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.16. |
...
A FieldScreenRenderer glues a FieldLayout (which governs requireability and hideability) with a FieldScreen (which governs tabs and ordering within tabs, and screen-level hideability). For example, it is possible for a field to be hidden on this screen but still visible on other screens.
FieldScreenRenderers are usually constructed with a user and a particular operation.
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Visibility of the field
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
$fixVersions
...
Collection of fix versions for the current ticket, array.
...
Provides metadata such as the platform, application, and their respective versions
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Returns the comments in HTML format
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
$issue
...
Render context: a stack rendering metadata
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Main interface for finding internationalized text in Jira
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
$labels
...
Collection of labels for the current ticket, array.
...
$linkCollection
...
Gets / sets the color of links within the document
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Shows whether it is possible to link issues in Jira.
True / false
...
$nowDate
...
$nowTime
...
Current project
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Current priority
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Collection of remote issue links that link to the given Jira issue.
Instance of java.util.Collection<com.atlassian.jira.issue.link.RemoteIssueLink>
...
This variable is used to see different contents in the dashboard or any other Confluence pages for anonymous users or to display different contents for different groups of users.
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Current issue custom field value
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
$renderer.renderField($issue, fieldName, defaultValue)
...
Current issue custom field value, where
- <issue> – current issue
- <name> – custom field name
- <default_value> – optional parameter.
If the value is "NULL" then the <default_value> will render.
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
$renderer.isNonEmptyArray($object)
...
$renderer.isCommentInternalServiceDesk($comment)
Is used to show internal comments.
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Resolution with which an issue can be closed.
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Code Block | ||
---|---|---|
| ||
$status.getSimpleStatus().getName() |
...
$stringUtils
...
- $components - a current issue collection of project components as array
- $affectVersions - a current issue collection of affect versions as array
- $fixVersions - a current issue of fix versions as array
- $currentUser - a current logged user
- $linkCollection - the instance of com.atlassian.jira.issue.link.LinkCollection for current issue
- $stringUtils - the instance of org.apache.commons.lang.StringUtils.StringUtils
...
- $encoder - the instance of com.atlassian.jira.util.JiraUrlCodec
- $comments - collection of objects com.atlassian.jira.issue.
...
- comments
...
Info | ||
---|---|---|
| ||
This feature is available starting with v1.9.17. |
...
Examples
Example 1
...
language | xml |
---|---|
title | Example 1, Show all comments of the task |
collapse | true |
- .Comment. You can loop through them using for instance
Example 1
#foreach($comment in $comments)
...
Example 2
...
language | xml |
---|---|
title | Example 2, Filtering comments by "Comment Internal" flag |
collapse | true |
...
<p>$comment.getBody()</
...
p>
...
...
...
#end
...
Example
...
2
...
language | java |
---|---|
title | Example 3, Using of field's rendering in templates |
collapse | true |
...
$assignee
$fieldRenderer.renderField("T3
...
Priority
...
Score")
...
$fieldRenderer.renderFieldById("customfield_10510")
...
Example 4
...
...
#set( $formatString = "EEE, MMM d, ''yy")
<table>
<thead>
<tr>
<th>Comments</th>
</tr>
</thead>
<tbody>
#foreach($comment in $comments)
<tr>
<td>$dateFormatter.withStyle($formatString).format($comment.getCreated()) $comment.getAuthorFullName()</td>
</tr>
<tr>
<td>
<p>$comment.getBody()</p><hr />
</td>
</tr>
#end
</tbody>
</table>
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<p>Public comments for the issue $issue.getKey() with summary "$issue.getSummary()"</p>
<hr />
#if ("$!comments" != "" && $comments.size() > 0)
#foreach($comment in $comments)
#if("$!comment.getRoleLevelId()" == "")
<p>
$comment.getCreated() $comment.getAuthorFullName()
<br />
$comment.getBody()
</p>
#end
#end
#else
<p>The task has not any comments</p>
#end |
Example 6
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#macro( renderJiraIssues $listTitle, $itemTitle $collection )
<h4>$title</h4>
<ul>
<li>title count: $subTasks.size()</li>
#foreach($issue in $collection)
<li>
<h5>$itemTitle</h5>
<ul>
<li>Key: "$issue.getKey()"</li>
<li>Summary: "$issue.getSummary()"</li>
</ul>
</li>
#end
</ul>
#end
<p>Public comments for the issue $issue.getKey() with summary "$issue.getSummary()"</p><br />
<ul>
<li>
#renderJiraIssues("Subtasks", "Subtask", $subTasks)
</li>
<li>
#renderJiraIssues("Issue Links", "Linked Issue", $links)
</li>
<li>
<h4>Remote Links</h4>
<ul>
<li>Remote Links count: $remoteLinks.size()</li>
#foreach($remoteLink in $remoteLinks)
<li>
<h5>Remote link</h5>
<ul>
<li>Title: "$remoteLink.getTitle()"</li>
<li>Url: $remoteLink.getUrl()</li>
</ul>
</li>
#end
</ul>
</li>
</ul> |
Info |
---|
Notes:
|