- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2020 12:05 AM
Hi All,
I just want to ask how to get the date/time the email notification was sent. Then after getting the value I want to pass that value to another field that is within the same form. Example, the email notification was sent when an INC is created, I want to be able to get the date/time the email was sent and I will pass that value to another date/time field that exist in the incident form. It will just be used for reporting purposes.
Thanks in advance.
Ramel
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2020 12:28 AM
Hi Ramel,
you would require business rule on email logs[sys_email] table and then pick the time when the type changes to sent and populate the updated time in incident record field.
Condition should be such that it only works for incident table
BR: On sys_email
After Update:
Condition: Target table is incident AND Type is sent
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var inc = current.document_id;
var gr = new GlideRecord('incident');
gr.get(inc);
gr.<field> = current.sys_updated_on; // give here the custom date time field
gr.update();
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2020 12:17 AM
Hi Ramel,
you would require business rule on email logs table and then pick the time and populate in incident record
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2020 12:20 AM
Thanks Ankur, can you advise how do I do the query. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2020 12:28 AM
Hi Ramel,
you would require business rule on email logs[sys_email] table and then pick the time when the type changes to sent and populate the updated time in incident record field.
Condition should be such that it only works for incident table
BR: On sys_email
After Update:
Condition: Target table is incident AND Type is sent
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var inc = current.document_id;
var gr = new GlideRecord('incident');
gr.get(inc);
gr.<field> = current.sys_updated_on; // give here the custom date time field
gr.update();
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2020 12:37 AM
Thanks a lot Ankur.