Need to Copy the Work Notes to Additional Comments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2024 03:42 AM - edited ‎08-23-2024 03:42 AM
I Need to Copy the Work Notes to Additional Comments on the incident form when the work notes of the incident is being updated after 5 days of the last update.
I tried using the After Business rule in order to copy the Work notes to Additional Comments and it is working fine. But it should only be copied it the Current date is greater or equal to 5 days from the last update.
Can someone please help me with the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2024 04:09 AM
You can write the following condition in the script section of your business rule-
var currentDate = new GlideDateTime();
var lastUpdatedDate = new GlideDateTime(current.sys_updated_on);
var diffInDays = GlideDateTime.subtract(currentDate, lastUpdatedDate).getNumericValue() / (1000 * 60 * 60 * 24);
if (diffInDays >= 5) {
Your Business Rule
}
Please mark my answer helpful and correct.
Regards,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2024 04:20 AM
Don't do this. Work notes are for the internal team and additional comments are for the customer. Why do you want to share the internal comments with the customer /caller?
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************