- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2017 10:51 AM
Why does the updated date not change after sending an email from within an incident? Our helpdesk often sends emails from within ServiceNow to our customers, but since the updated date doesn't change after sending an email, it's difficult to see when the incident was actually last updated. See example below:
I created an incident and posted an additional comment and it shows a date/time in the activity log of 2017-06-15 10:38:22. I then sent an email from within the incident and it shows in the activity log as being sent at 2017-06-15 10:42:34.
However, the Updated date still shows 2017-06-15 10:38:22.
Does anyone know how to fix this?
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2019 10:03 AM
Hi Deepali,
Sachin was referring to a Business Rule, created on the sys_email table. However, I don't think forcing the Updated [sys_updated_on] field to update, instead of letting it update automatically is best practice.
I ended up copying sent email from the email client to the Additional comments, and then updating my notifications so don't send a duplicate of the previously sent email (I added filter condition: updated_by is not system). Since updating Additional comments updates the Updated [sys_updated_on] field, this solved my problem.
This is the Business Rule on the sys_email table I created to copy sent email from the email client to the Additional comments:
Script on Advanced tab:
copyComments();
function copyComments() {
// Verify if the mail was sent from the mail client and not a Notification
var headers = current.headers;
var isMailClient = headers.search("X-ServiceNow-Source: EmailClient");
if (isMailClient != -1) {
var incident = new GlideRecord('incident');
incident.addQuery('sys_id', current.instance);
incident.query();
// Copy the body of the email to the additional comments
while(incident.next())
{
var str = '[code]' + current.body + '[/code]';
var itsender = current.sys_created_by;
incident.comments = "An email was sent by " + itsender + "\n\n" + str;
incident.update();
}
}
}
Hopefully this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 09:44 PM
Hi @Amanda Stoupa ,
I am still not getting the updated field updated whenever the email is sent in the activities section.
Please find the screenshots and could you help me if possible?
I have also tried it @sac2 way , but still the issue persists
Thanks is advanced !