AnsweredAssumed Answered

Script to Modify a record after N days is not working.  Need Help

Question asked by xxx202xxx on Jul 17, 2017
Latest reply on Jul 18, 2017 by beverly

Ok, Here is my problem.  I am performing a find on my Service table looking for a specific status.  Once found, if it is more than N days old a Closed Ticket script is run that will change the status from resolved to closed.  My problem is after the perform find.  After records are found the if statement will run on the first Resolved status ticket found.  If that ticket is less than N the script ends and will never go to the next record.  I even tried to stick a sort records after the perform find the same thing happens

 

go to layout

enter find mode

set field [ServicMGMT::Status; "Resolved"]

perform find

sort records [Ascending; ServiceMGMT::ModifiedTime]

If [ServiceMGMT::ModifiedTime <= (Get (CurrentTimestam0 -5 * 24 * 3600)]

Perform Script ["Close Ticket"]

End if

show all records

exit script

Outcomes