- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2023 03:34 AM
Hi,
I need to close the problem ticket if its in resolved state for last 14 days.
Can someone please guide me to achieve this.
Thanks,
Priyanka
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2023 08:08 AM
Thanks everyone my script is working now as i have just compared two dates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2023 07:49 AM
Thanks @Chetan Mahajan
But getDateDiffExcWeekends- is not working it seems as its not updating the state to closed. Can we use something else instead of getDateDiffExcWeekends to exclude weekends
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2023 03:51 AM
Hello Priyanka77,
I assume that the field 'resolved_at' stores the date when the problem is resolved. I would create an scheduled job running it once per day out of office schedule and then compare resolved_at date with the current date, if the difference it's greater that 14 days I'll update the state to close.
☆ Community Rising Star 22, 23 & 24 ☆
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2023 04:11 AM
Hello Priyanka77,
As per @Adrian Ubeda suggestion, write a scheduled job then first fetch all the Resolved problem using GlideRecord() function and then compare "resolved_at" date and current date find both date difference using gs.Datediff() function, if both date difference is greater than 14 then update state field to close.
Mark Helpful ,Please give positive feedback.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2023 08:08 AM
Thanks everyone my script is working now as i have just compared two dates