Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
titleAvailability

This feature is available starting with v1.9.17.

...

Fields inherited from class com.atlassian.Jira.ofbiz. See AbstractOfBizValueWrapper for more information.

Info
titleAvailability

This feature is available starting with v1.9.17.

...

Current attachment filenames

Info
titleAvailability

This feature is available starting with v1.9.17.

...

Users can access Jira applications through this URL

Info
titleAvailability

This feature is available starting with v1.9.17.

...

$created

...

$components

...

$comments

...

Is used to retrieve and create comments

Info
titleAvailability

This feature is available starting with v1.9.17.

...

This is used to add, update, retrieve, and delete properties from сomments

Info
titleAvailability

This feature is available starting with v1.9.17.

...

Time when the current ticket was created

Info
titleAvailability

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
languagejava
$dateFormatter.withStyle("EEE, MMM d, ''yy").format($issue.getUpdated())

...

Formatter for printing and parsing date-time objects

Info
titleAvailability

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
languagejava
$fieldRenderer.renderWiki2Html($description)
Info
titleAvailability

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
titleAvailability

This feature is available starting with v1.9.17.

...

Visibility of the field

Info
titleAvailability

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
titleAvailability

This feature is available starting with v1.9.17.

...

Returns the comments in HTML format

Info
titleAvailability

This feature is available starting with v1.9.17.

...

$issue

...

Render context: a stack rendering metadata

Info
titleAvailability

This feature is available starting with v1.9.17.

...

Main interface for finding internationalized text in Jira

Info
titleAvailability

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
titleAvailability

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
titleAvailability

This feature is available starting with v1.9.17.

...

Current priority

Info
titleAvailability

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
titleAvailability

This feature is available starting with v1.9.17.

...

Current issue custom field value

Info
titleAvailability

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
titleAvailability

This feature is available starting with v1.9.17.

...

$renderer.isNonEmptyArray($object)

...

$renderer.isCommentInternalServiceDesk($comment)

Is used to show internal comments.

Info
titleAvailability

This feature is available starting with v1.9.17.

...

Resolution with which an issue can be closed.

Info
titleAvailability

This feature is available starting with v1.9.17.

...

Code Block
languagejava
$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
titleAvailability

This feature is available starting with v1.9.17.

...

Examples

Example 1

...

languagexml
titleExample 1, Show all comments of the task
collapsetrue
  • .Comment. You can loop through them using for instance

Example 1

 #foreach($comment in $comments)
   

...

Example 2

...

languagexml
titleExample 2, Filtering comments by "Comment Internal" flag
collapsetrue

...

 <p>$comment.getBody()</

...

p>

...


 

...

  

...

 #end

...

Example

...

2

...

languagejava
titleExample 3, Using of field's rendering in templates
collapsetrue

...

$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
languagexml
titleExample 5, Show only public comments and related author of the task. If there are no comments display the message about it
collapsetrue
<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
languagexml
titleExample 6, Show info about all Issue's links, remote links and subtasks
collapsetrue
#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:

  1. Special symbols. Use: &larr; &darr; &harr; &uarr; &rarr; &euro; &copy; and &lt;
  2. For Cyrillic use in body tag: style="font-family: Arial Unicode MS, FreeSans;"
  3. To break page based on the length of a custom field value use following style
    • page-break-before: always
    • page-break-after: always
  4. Use $!var when you want use velocity quiet refecence notation. Using the quiet reference notation circumvents Velocity's normal behavior. Suppose, you have $email var and do not want to see in the report "$email" value, if the variable has no value. Just use $!emal and check result for empty string.
  5. Support for &, <, > symbols for Word templates is added starting with 1.9.17 version.

See also

PDF - Adding Easy PDF Word Issue Templates