Versions Compared

Key

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


Panel

On this page

Table of Contents
exclude(On this page).*
stylecircle
typeflat
separatorpipe



UI Text Box
sizemedium
typeinfo

Within sumUp calculation rules are used in nearly every context to tell the app which fields should be calculated and which output format should be used.

To further customize the output format, velocity templates can be used!


On this page you'll find some predefined templates that can be used right away to adapt a rule's output format.

Velocity template

To use a custom output format in the rule, select "Velocity template" as shown below:

The velocity context

UI Text Box
typetip

Need help?

If you unfamiliar with velocity templates, you might want to check out the official documentation.

The Velocity Context is initialized with the following content:

keyClassDescription
$valuejava.lang.BigDecimalThe computed value.
$number

com.atlassian.jira.util.velocity.NumberTool

A helper class to format numeric values.
$jiraDateTimeUtilsinternalA helper class which has one function:
getTimeFormatedString(long value).

This function formats timespan according to the time configuration in JIRA.

$formatter

java.text.SimpleDateFormat

JavaSimpleDate format with format ("EEE, d MMM yyyy h:mm a")

These keys can be used within the templates to customize the format.

Templates

  • Default Format

Code Block
languagexml
themeMidnight
#if($value)
$value
#end


  • Hours Format

Code Block
languagexml
themeMidnight
#set($H = '#')
#if($value)
#set($v = $value.doubleValue()/3600.0)
$number.format("$H.$H$H",$v)h
#end

(info) Assumes that the value is in seconds.


  • Jira Timespan Format

Code Block
languagexml
themeMidnight
#if($value)
$jiraDateTimeUtils.getTimeFormatedString($value.longValue())
#end

(info) Assumes that the value is in seconds.


Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue