Skip to end of banner
Go to start of banner

_PDF - Template Examples

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

You can use following templates:

Show all comments of the task

Example 1
 #foreach($comment in $comments)
   <p>$comment.getBody()</p>
 #end

Exporting wiki formatted data from Issue comments section

Example 1
 #foreach($comment in $comments)
  <p>$fieldRenderer.renderWiki2Html($comment.getBody())</p>
#end

Filtering comments by "Comment internal" flag

Example 2
<p>Comments:<br />	
#if ($comments != $null && $comments.size() > 0)
 #foreach($comment in $comments)
   #if ($renderer.isCommentInternalServiceDesk($comment)) 
	<span>Internal JIRA SD comment: $comment.getBody()</span><br />
   #end
 #end
#end
</p>

Fields rendering in templates

Example 3
$assignee
  $fieldRenderer.renderField("T3 Priority Score")
  $fieldRenderer.renderFieldById("customfield_10510")

Show all comments and related author of the task in the table format

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>

Show only public comments and related author of the task

Example 5
<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

Show info about all Issue's links, remote links and subtasks

Example 6
#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>

See also

PDF - Adding Easy PDF Word Issue Templates

  • No labels