Autoclose problem ticket if its in resolved state for 14 days

Priyanka77
Tera Guru

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

1 ACCEPTED SOLUTION

Priyanka77
Tera Guru

Thanks everyone my script is working now as i have just compared two dates 

View solution in original post

8 REPLIES 8

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

Adrian Ubeda
Mega Sage
Mega Sage

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.


If it was helpful, please give positive feedback! āœ”
ā˜† Community Rising Star 22, 23 & 24 ā˜†

komaladsul
Kilo Guru

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.

Priyanka77
Tera Guru

Thanks everyone my script is working now as i have just compared two dates