- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 04:56 AM
Hello ServiceNow family,
Greetings of the day!
I wanted to populate approval time (for RITM)(When the request is approved or rejected (Date and time)) in the sys_approval_approver table.
I have checked and found that there is no OOB functionality.
I have created a field in the approval table named 'approved on'. But unable to populate approval date and time in it.
Please any one suggest me how I can do this task.
Best Regards,
Rajesh Mishra
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 05:13 AM - edited 10-20-2023 05:23 AM
Hi @Community Alums ,
Create after update business rule on sys_approval_approver table
(function executeRule(current, previous) {
if (current.state == 'approved' || current.state == 'rejected') {
var gDate = new GlideDate();
current.setValue('approved_on', gDate);
}
})(current, previous);
Please mark it as helpful and solution proposed if it works for you .
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 05:13 AM - edited 10-20-2023 05:23 AM
Hi @Community Alums ,
Create after update business rule on sys_approval_approver table
(function executeRule(current, previous) {
if (current.state == 'approved' || current.state == 'rejected') {
var gDate = new GlideDate();
current.setValue('approved_on', gDate);
}
})(current, previous);
Please mark it as helpful and solution proposed if it works for you .
Thanks,
Anand