Beside standard Velocity constructs like @last @first, $myarray.isEmpty() or $myarray.empty there are several helpers which can address specific problems when running Jirassimo notifications.
boolean $jirassimo.isAfter($firstDate, $secondDate)
Used to compare if $firstDate is after $secondDate. Both dates must be either in yyyy-MM-dd or yyyy-MM-dd'T'HH:mm:ss.SSSZ formats.
Typical use cases of this function is checking whether update of the issue happened after $context.today or $context.yesterday or $context.onehourago. For example, checking whether issue was updated in last hour or since yesterday.
boolean $jirassimo.isSameUpdate($firstDate, $secondDate)
Checks whether the difference between $firstDate and $secondDate is less than 1 second. This is useful to check whether issue update and comment created happened during the same logical update.
Both dates must be in format yyyy-MM-dd'T'HH:mm:ss.SSSZ
String $jirassimo.settingValue($key)
This function retrieves value from Settings based on $key supplied. Settings are basically collection of key=value pairs and they are helpful if you need, for example, to find out user's channel from his email.
String $jirassimo.formatDate($dateValue, $format)
Formats given $dateValue date using format in $format. If $format is omitted then MM-dd-yy hh:mm will be used.
$dateValue can be: String, long or java.time.Instant
String $jirassimo.formatNumber($numberValue, $format)
Formats given $numberValue using format in $format. Standard Java DecimalFormats are supported.
$jirassimo.includeAttachments($pattern)
Sends attachments from current Issue to email/slack/hipchat. $pattern defines extensions that attachment must match against. If not specified then all.
$jirassimo.customBotAvatar($customBotAvatarUrl)
Customises Slack avatar of Jirassimo bot. $customBotAvatarUrl must be an absolute URL of avatar image.
$jirassimo.groupEmails("JIRA_GROUPNAME")
Retrieves a comma-separated list of emails of JIRA users belonging to specified JIRA group
$jirassimo.calculateAgeDays($!issue.fields.created)
Returns age of an issue in days
$jirassimo.userProperty($userKey, $propertyName)
Allows you to retrieve a value of JIRA property for the specified user key.
$jirassimo.convertAndFormatDate($dateValue, $timezone, $format)
Parses the date from $dateValue and outputs it in given $format with specified $timezone. Timezone code must be one value from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones in column TZ*
$jirassimo.appendAtlassianCSS()
Email only! Inlines Atlassian CSS to email elements to make it look consistently with Atlassian look-n-feel.
$jirassimo.customEmailFrom($value)
Allows to provide dynamic value for email "From name". This can be a hardcoded constant or a value from $issue, like $issue.fields.assignee.displayName
$jirassimo.customEmailFromAddress($value)
Allows to provide dynamic value for email "From" address. This can be a hardcoded constant or a value from $issue, like $issue.fields.assignee.emailAddress
$jirassimo.settingKeys()
retrieve array of all keys in user-defined Raley notification settings
$jirassimo.mentionsEmails($value)
retrieve a comma-separated list of emails of users that are mentioned in specific text field. Example: $jirassimo.mentionsEmails($issue.fields.description) will give you all users mentioned in issue description
$jirassimo.emailReplyTo($value)
For email notifications sets ReplyTo value
$jirassimo.emailPriority($value)
For email notifications sets Email Priority (X-Priority header value)
$jirassimo.userHasRole(projectRoleName, projectKey, jiraUsername)
Checks if a Jira user referenced by jiraUsername has a project-specific role with name projectRoleName in a project whose key is projectKey. Example of use in this wiki article
$jirassimo.customEmailHeader(headerName, headerValue)
Adds a header to outgoing email with name headerName and value headerValue
$jirassimo.getProjectRoleEmails("PROJECT_ROLE_NAME", "PROJECT_KEY")
Returns a comma-separated list of emails of users who have role PROJECT_ROLE_NAME in project referenced by project key PROJECT_KEY. More details on usage of this function in this wiki article
$jirassimo.getUserLanguage("USER_KEY")
Returns a 3-letter language code of user's locale specified by USER_KEY. Examples: ita, rus, fin
$jirassimo.getFieldHTML(fieldValuePlainText)
Returns HTML representation of field value expressed in fieldValuePlainText. This function works only if field is rendered using Wiki-Style-renderer.
Example: $jirassimo.getFieldHTML($issue.fields.description) - will return issue description in HTML format
$jirassimo.getElementsField(issueId, customFieldCode)
Returns value for Elements Connect field for given issue id with customfield code = customFieldCode.
Example: $jirassimo.getElementsField($issue.id, "customfield_10001")
String $jirassimo.unescapeHTML(htmlString)
unescapes provided htmlString and returns it