How to get task sla data on an incident email notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2011 08:16 AM
I just received a request to add the business time left to all email notifications that go to the assigned user and assignment groups.
The emails contain the majority of the information included on the incident form. Is there a way using a mail script to pull the information from the incident/sla table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2011 11:58 AM
You will have to write a script in the email notification to find the task_sla record that is connected to that incident and then you would be able to display any field form that task_sla records on that notification
http://wiki.service-now.com/index.php?title=Scripting_for_Email_Notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2011 12:53 PM
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>
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2011 09:46 AM
Thanks loads, this is exactly what I was looking for. The only problem I'm having is that the days are printing out as 1970-01-02 the hours, minutes and seconds look great 23:48:50. I'm using bht Business Time Left and Planned End Time. Both look the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2011 11:02 AM
DAH - getDisplayValue() gives me exactly what I'm looking for.