How to add sla response (duration) field in notification message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 02:04 PM
Hi
In notification message, i would like to include what's the priority of a case along with response time (duration).
Ex: if the case is P1 and Response for it is 15min. Message would be "hey your case is 1-Critical and expect response in 15min.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 02:48 PM
Hi @Niranjan2 ,
You could write a script in the notification to print any related SLA info in your email:
<mail_script>
var sla = new GlideRecord('task_sla');
sla.addQuery('task', current.sys_id);
sla.query();
while(sla.next()){
template.print(sla.time_left + "\n");
//at this point you can print out any fields from the task_sla table using the sla GlideRecord object looking at the example above
}
</mail_script>
Note: Ttask has a 1 to many relationship with task SLA and so you have no ability to dot walk to the sla records that are created in task_sla table, also the task_sla record would be created after the task is inserted and so could potentially not be available.
if there will be only 1 SLA that needed to be identified per task, then I would look at moving the notification from your task table to task_sla and triggering on insert of the task_sla record as you can then dot-walk back to your task record to populate all of the details.
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda