Get the updated time and date of a particular field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2019 10:39 PM
Hi SN community,
I want to get the updated date and time of a particular field in the business rule. How is it possible? In my requirements I want to get the updated date/time of current.comments each time a new comment added.
Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2019 10:46 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2019 10:47 PM
Hi,
Create one bussinessrule After Update. And add below condition:
Additional comments changes.
In the script part you get the value of 'updated' field.In that you get the date time.
var dateTime=current.sys_updated_on//get the date time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2019 10:47 PM
Hi,
So basically you want the timestamp when comments are added; you can have after update business rule on the table and condition as comments changes
script below to get the time when comments is added
var gdt = new GlideDateTime();
gs.info('Time is: ' + gdt);
But ideally the sys_updated_on on that table should tell you the time comments are updated since it is a field value getting updated
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
12-13-2019 12:15 AM