- 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:45 AM
You are welcome
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
02-07-2024 09:58 AM
I have a similar requirement but only difference is, i need to implement this in customized table. I have implemented the way you have mentioned above. But it is not working for me. Not sure what is current.document_id and current.sys_update_on.
Could you please help me with this?