This page is about Time to SLA for Jira Server. Using Jira Cloud? Click the Cloud button above.
TTS offers a flexible way of creating dynamic email content. On this page, we will list the potential parameters you can use, and give you some handy tips.
Parameter | Type | Description |
---|---|---|
${slaDescription} | String | Name of the SLA |
${dateTool} | DateTool can be used to format dates. (v7.7.0+) Example:
| |
${dateTimeFormatter} | DateTimeFormatter can be used to format dates with predefined formats in Jira. (v7.7.0+) Example
| |
${slaValue} | String | SLA value as a time string |
${slaStartDate} | String | Start time of the SLA |
${slaEndDate} | String | End time of the SLA |
${slaNotifyBefore} | String | Notify before parameter in notification settings |
${originStatus} | String | Origin status name, null if origin is not set by status |
${targetStatus} | String | Target status name, null if target is not set by status |
${slaExceeded} | Boolean | Indicates whether or not SLA is exceeded Example:
|
${slaRemainingTime} | String | Remaining duration of SLA (i.e. 1h 30m) |
${slaOverdue} | String | Overdue duration of SLA (i.e. 1d 10h) |
${issue} | Issue object to retrieve various issue attributes (e.g. | |
${customFieldManager} | CustomFieldManager could be used to insert custom field values into e-mail text Example:
| |
Get priority information | ||
| Get link information |
Tip for Template Variables:
In some cases, custom fields or other fields on the issue may have a null value, resulting in variable names being displayed in email content.To prevent this, put an ! after $ sign on a variable name like this:
$!{issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_11100'))}
🤔 How can I format dates with a custom time zone?
You can change the time zone of the dateTimeFormatter provided in the notifier context.
1. Copy the following code block into your notifier content:
#set( $tz = $dateTool.getTimeZone().getTimeZone("IST"))
#set( $zonedFormatter = $dateTimeFormatter.withZone($tz))
#set( $date = $issue.created)
Created Date: ${zonedFormatter.format($date)}<br>
2. Change IST with any time zone you would like to apply. Find a list of all available time zones here.
3. Change $date with any date you would like to format.
4. You can also apply custom time formats with zonedFormatter as usual.
Advanced Tip:
You can use loops, if/else conditions, and other Velocity templating engine features in Time to SLA notifier templates. More information can be found in the official Velocity guide.
Here is an example of how you can iterate over the selected users in a multiple user picker custom field and display their real names:
#set( $users = $!{issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_10300'))})
Custom Field (Multiple user picker):
#foreach( $user in $users )
$user.displayName#if( $velocityHasNext ),#end
#end