Skip to end of banner
Go to start of banner

PDF - Configuring Templates

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 27 Next »

The uploaded template file must be XHTML or Docx file. Template supports inline CSS and all markup attributes. The sample you may download here: html and docx.

You can use predefined variables as ${varname} 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 - wiki content from the current ticket custom field, available starting with v2.0.2
  • $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 - the collection of objects com.atlassian.jira.issue.comments.Comment. You can loop through them using for instance
  • $customField - an array of custom fields that you can access from the current task (available with version 2.0.4 and above)

Example 1

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

Example 2

$assignee

$fieldRenderer.renderField("T3 Priority Score")

$fieldRenderer.renderFieldById("customfield_10510")


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

See also

PDF - Adding Easy PDF Word Issue Templates

  • No labels