Hello, I have a JSM project and automation to send email to managers once a SLA is breached. I am using the send email automation to draft my email and to present the details in table format. However, I am unable to calculate and reflect the Days Overdue (or the days SLA breached) in the email. Currently my email shows the Days Overdue as empty (screenshot). Below is what I used for the email draft:
<p style="font-family: Arial, sans-serif; font-size: 12px; margin: 0 0 8px 0;">
Hi Line Manager(s),
</p>
<p style="font-family: Arial, sans-serif; font-size: 12px; margin: 0 0 12px 0;">
The following Gate(s) have <b>breached SLA (>3 Working Days)</b>.
Please follow up with the Control Owner(s) listed below.
</p>
<div style="font-family: Arial, sans-serif; font-size: 12px; max-width: 980px;">
<table role="presentation" cellpadding="0" cellspacing="0"
style="
border-collapse: collapse;
width: 100%;
table-layout: fixed;
border: 2px solid #333;
">
<thead>
<tr style="background-color:#6F2DBD; color:#fff;">
<th style="border: 2px solid #333; padding: 8px; text-align:left; width: 16%; word-break: break-word;">
Work Item Key
</th>
<th style="border: 2px solid #333; padding: 8px; text-align:left; width: 44%; word-break: break-word;">
Summary
</th>
<th style="border: 2px solid #333; padding: 8px; text-align:left; width: 22%; word-break: break-word;">
PTO Gate Control Owner(s)
</th>
<th style="border: 2px solid #333; padding: 8px; text-align:left; width: 10%; word-break: break-word;">
Status
</th>
<th style="border: 2px solid #333; padding: 8px; text-align:left; width: 8%; word-break: break-word;">
Days Overdue
</th>
</tr>
</thead>
<tbody>
{{#lookupIssues}}
<tr>
<td style="border: 2px solid #333; padding: 8px; vertical-align: top; word-break: break-word;">
<a href="{{url}}" style="color:#0052CC; text-decoration: underline; font-weight:bold;">
{{key}}
</a>
</td>
<td style="border: 2px solid #333; padding: 8px; vertical-align: top; word-break: break-word;">
{{summary}}
</td>
<td style="border: 2px solid #333; padding: 8px; vertical-align: top; word-break: break-word;">
{{#PTO Control Owners}}
<a href="mailto:{{emailAddress}}" style="color:#0052CC; text-decoration: underline;">
{{displayName}}
</a><br/>
{{/PTO Control Owners}}
</td>
<td style="border: 2px solid #333; padding: 8px; vertical-align: top; color:#000;">
In Review
</td>
<td style="border: 2px solid #333; padding: 8px; vertical-align: top; color:#000; text-align: center; font-weight: bold;">
{{issue.["Time to Level 2 Escalation"].ongoingCycle.breachTime.diff(now).days.abs}}
</td>
</tr>
{{/lookupIssues}}
{{^lookupIssues}}
<tr>
<td colspan="5" style="border: 2px solid #333; padding: 10px; color:#666;">
No breached gates found.
</td>
</tr>
{{/lookupIssues}}
</tbody>
</table>
</div>
<p style="font-family: Arial, sans-serif; font-size: 11px; color: #666; margin-top: 10px;">
<i>Generated by Jira Automation.</i>
</p>
Hi @Nur Fatin
Can you try using the smart value:
{{issue.sla.{{sla_name}}.ongoingCycle.breachTime.toDays().floor()}})
Also see this KB for more info, /how-to-find-smart-value-of-sla-component-of-jsm-issues
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.