AnsweredAssumed Answered

How to script an Email Counter to prevent multiple emails?

Question asked by xxx202xxx on Aug 29, 2017
Latest reply on Aug 30, 2017 by xxx202xxx

Problem: Lets say the below script runs on Monday and finds 5 Tickets. Then sends out emails to the user/s responsible for each ticket.  Then on Tuesday when the script runs again it finds the 5 tickets from Monday along with 5 more tickets.

 

Question: How can I set it up where the tickets found on Monday will not receive another email while the 5 new tickets will receive an email.   Then whatever the duration  ((Get (CurrentTimestamp -7 * 24 * 3600) emails will be sent again.  So the tickets from Monday will receive a 2nd email again in 7 days.

 

(Thanks Phil for the below info)

Set Error Capture [on]

enter find mode

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

Set field [ServiceMGMT::ModifiedTime ; "<=" & (Get (CurrentTimestamp -7 * 24 * 3600)]

perform find

If [ Get ( FOundCount ) > 0 ]

    loop

           Send Mail to AccountName

          go to next, end at last

     end loop

End If

Outcomes