Issue using a custom schedule script to close tickets

Issue using a custom schedule script to close tickets

Hi,


We want to close all spam tickets, so this is the SQL query for the oldest 100 tickets, that are not closed, with a created date between 01-01-2020 and 23-07-2022:

SELECT top 100 "qd"."QUEUENAME" AS "Group", "wo"."WORKORDERID" AS "Request ID"  FROM "WorkOrder" "wo" LEFT JOIN "WorkOrderStates" "wos" ON "wo"."WORKORDERID"="wos"."WORKORDERID" LEFT JOIN "StatusDefinition" "std" ON "wos"."STATUSID"="std"."STATUSID" LEFT JOIN "WorkOrder_Queue" "woq" ON "wo"."WORKORDERID"="woq"."WORKORDERID" LEFT JOIN "QueueDefinition" "qd" ON "woq"."QUEUEID"="qd"."QUEUEID" WHERE  ( ( ( "qd"."QUEUENAME" = 'Automatic Reply & Junk - Group' ) AND ( ( "std"."STATUSNAME" != 'Closed' ) OR ( "std"."STATUSNAME" IS NULL ) ) ) AND ( ( ( "wo"."CREATEDTIME" >= 1577836800000 ) AND ( ( "wo"."CREATEDTIME" != 0 ) AND ( "wo"."CREATEDTIME" IS NOT NULL ) ) ) AND ( ( "wo"."CREATEDTIME" <= 1658617199999 ) AND ( ( ( "wo"."CREATEDTIME" != 0 ) AND ( "wo"."CREATEDTIME" IS NOT NULL ) ) AND ( "wo"."CREATEDTIME" != -1 ) ) ) ) )  AND wo.ISPARENT='1'  ORDER BY 1, 2

I've tried both the Auto_Close and Auto_Close_Updated scripts, but having no joy with either of them.

And yes, I've placed the AutoClose.py in integration\custom_scripts.
And in integration\custom_scripts\executor_files, there is a .txt file with "python AutoClose.py".
And then for the Executor, selected 'Execute Script' and then named the .txt file to use.

Any help, please?

Build 13009

                  New to ADSelfService Plus?