Hi all Java Pros,

Previously I have took some coding from this forum regarding the 3days Auto-close incident tickets that is in Resolved Status. I need some explanation on the codes and if possible some guide on how to edit it. Mainly to test it out on lets say 5-10mins interval. I do not know which codes to edit to do so.

Codes below:-
Code:
IMClosure();
function IMClosure()
{

var Rel = new SCFile('screlation');
var explanation = new Array();


tolerancja=168;
oT = new Date();
oT.setHours(oT.getHours()-parseInt(tolerancja));

CT = new XMLDate(oT);
var IncRek = new SCFile('probsummary');
var IncRekRes = IncRek.doSelect("problem.status=\"Resolved\" and resolved.time<'"+ CT.getSCDateTimeString() +"' ");
if (IncRekRes == RC_SUCCESS)

do {
IncRek.resolution_code="Auto Closed by system"; //Auto Closed by system muz b put in closurecode
IncRek.explanation=['Auto Closed by system'];
IncRek.doUpdate();                 //fill-in aka update the ticket
IncRek.doAction("close");             //calls that close button in the ticket

var RelRes = Rel.doSelect('source = "'+ IncRek.number +'" and source.filename="problem" and depend.filename="incidents" and depend.active="true"');

if ( RelRes == RC_SUCCESS)
do
{
var IntRek = new SCFile('incidents');
var IntRekRes = IntRek.doSelect('incident.id = "'+Rel.depend+'"');
IntRek.open="Closed";                 //status in incident ticket closed
} while (Rel.getNext() == RC_SUCCESS)

} while (IncRek.getNext() == RC_SUCCESS)
}
Steps taken:-
Go to Script Library
Fill in the script info - Name: IMClosure
Place the script in the script editor
Click Add
Click on Compile

Create a Schedule Record (sch)
Name: Auto Close IM
Class: report
Repeat Interval: 04/11/10 00:24:00
In JavaScript Tab, fill in:-
system.library.IMClosure.IMClosure()
Click Add
Need help urgently.

Thank you!!