Beside standard Velocity constructs like @last @first, $ myarray . isEmpty () or $ myarray . empty there are several helpers which can address specific problems when running Raley 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.
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.serviceDeskCustomersEmails("JIRA_PROJECT_KEY")
Retrieves a comma-separated list of emails of all customers in a ServiceDesk that's associated with given Jira project key
$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.collectMentionsEmails($JiraTextOrTextAreaField)
Given the Jira field, find users mentioned in it and return a collection of users' emails.
$jirassimo.interval ($firstDate, $secondDate, $unit)
Given two dates or datetimes in one of Jira cloud format:
yyyy-MM-dd'T'HH:mm:ss.SSSZ
MM-dd-yy hh:mm
yyyy-MM-dd
yyyy-MM-dd HH:mm
Find the absolute number of DAYS or HOURS between first and second date. Third argument ($unit) must be of value either "DAYS" or "HOURS"
$jirassimo.resolveNames ($inputCommentString)
Will search for occurrence of mentions that contain accountid and replace the accountid to fullname of mentioned user
$jirassimo.attachThumbnailTargets()
For each attachment that is appended inline and has a target image Raley will add the TARGET image as a regular file attachment. This way, if your email client is able to handle inline attachments properly - everything will work smoothly. But if your client is tricky like (MS Outlook), then the target image will still appear as a separate attachment - only the embedded thumbnail link won't work.
$jirassimo.getNewElements($from, $to)
Returns a java.util.List that you can later iterate on which contains all values from $to that are not present in $from.
Both, $from and $to should be comma-separate values. Empty strings and nulls are allowed