I want to send mutiliple notifications on certificate expiry

lakshmi2
Kilo Contributor

I am facing issue with generate multiple notifications.

I have   created new event called certificate.expiring for u_certificate_tracking.
Do we need to write business rules or scripts for this table?

I want to send notifications for below 4 conditions..

         

Trigger CriteriaDaysMode
First Email60 DaysAlert
Second Email45 DaysWarning
Third Email30 DaysCritical
There afterEver day from 15days or lessBusiness Critical
1 ACCEPTED SOLUTION

Vipin Murugesan
Kilo Sage

Hi Tejaswitha,



var gr= new GlideRecord('ast_contract');   // lets say this your table


gr.addQuery('active', true);  


gr.query();      


while (gr.next())


{


var holder = gs.dateDiff(gr.getDisplayValue('u_certificate_tracking'), gs.nowDateTime(), false) ; // change according to your custom field name


holder = holder.split(' ')[0];


if (holder == 60)


{



gs.eventQueue('certificate.expiring.60',gr); // fire an event when it is 60 days



}



}




Note :- 1. create 4 different Notifications and events


                      2. change the values in if condition (eg: 60,45,30,<=15) and events names for firing other notification


                      3. create 4 different similar scripts by changing values


                              suppose if you use if statement and few certificates may expire on 45


                              and few may 60 so when 1st conditions satisfy it may not look for else condition


                        4. I created scheduled jobs which runs every day to check this condition and fire notification



PS: Hit like, Helpful or Correct depending on the impact of the response


View solution in original post

6 REPLIES 6

Deepak Ingale1
Mega Sage

Hi Tetaswitha,



You will have to write a schedued job which will query the records which are due for certicate expiry based on time stamp and send the email.



Another approach could be to use workflows.



How to create Approval Reminder Mails. (Simple and Easy Approach)


Vipin Murugesan
Kilo Sage

Hi Tejaswitha,



var gr= new GlideRecord('ast_contract');   // lets say this your table


gr.addQuery('active', true);  


gr.query();      


while (gr.next())


{


var holder = gs.dateDiff(gr.getDisplayValue('u_certificate_tracking'), gs.nowDateTime(), false) ; // change according to your custom field name


holder = holder.split(' ')[0];


if (holder == 60)


{



gs.eventQueue('certificate.expiring.60',gr); // fire an event when it is 60 days



}



}




Note :- 1. create 4 different Notifications and events


                      2. change the values in if condition (eg: 60,45,30,<=15) and events names for firing other notification


                      3. create 4 different similar scripts by changing values


                              suppose if you use if statement and few certificates may expire on 45


                              and few may 60 so when 1st conditions satisfy it may not look for else condition


                        4. I created scheduled jobs which runs every day to check this condition and fire notification



PS: Hit like, Helpful or Correct depending on the impact of the response


lakshmi2
Kilo Contributor

Do I need to right 4 different schedule jobs or is it possible to create single schedule job with 4 conditions


Hello,



I would write one schedule that triggered a notification where the information in the notification is created by an email script.


That way you only need to add script in the email script.



I have a version of this where notifications differ depending on a lot of things in a task record.



With regards


Anton Vettefyr