Have email notification on the 1st date of each month to group for contracts which reach or over expiration condition. (180 days expiration date)

sudaporn
Giga Expert

I want the system to send email when contracts reach or over expiration condition     , The email will notify everyone in group. For example , contract ends on 30/12/2017. For example , contract ends on 30/12/2017. Notification condition is 6 months before end date. So the system should send notification from 1/6/2017 ,1/7/2017, 1/8/2017.... until the contract is renewed or extended.

Now I used condition checks within 180 days and used "Contract Threshold breached" on notification

>> I want to email notification on the 1st date of each month (within 180 days)     How I config this.

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Since you want to send email to each user whose contract will end.


so trigger event from the script and set the recipient in mail notification script from the value of event parm


http://wiki.servicenow.com/?title=Scripting_for_Email_Notifications#gsc.tab=0


find_real_file.png


View solution in original post

14 REPLIES 14

Deepak Kumar5
Kilo Sage

Create a Scheduled script which runs on Every Month first day.


Write a script to trigger a event and set parm1 as the recipient email Id, Now use your notification and send email to the recipient from event.



Copy the query from filter and apply it in your script.


find_real_file.png


Now I config condotion within 180 days , I want to email notification on the 1st date of each month (within 180 days)    



I to do ?   Create a Scheduled script which runs on Every Month first day   (what the menu "Scheduled script " sorry I don't know)


find_real_file.png


Query on user table list view and copy the query from there then use that in scheduled script like below. use mail script to send mail to event.parm1




var gr = new GlideRecord('sys_user');


gr.addEncodedQuery(queryString);


gr.query();


while (gr.next()) {


  gs.eventQueue("event name", current, gr.email);


}



find_real_file.png


where the data tell to send mail on Every Month first day   , many thank you