Trying to create a notification on Configuration Item[cmdb_ci] table referring to Warranty Expiration field

prudhvig
Tera Expert

Hi,

I have to create a notification on the CI table. On that CI table, I have a field named Warranty Expiration. If the warranty is going to expire in the next 30 days, I want it to notify me.

I have created a condition in the builder but unable to receive a notification.

My notification is as follows:

Screenshot (71)_LI.jpg

Condition is : Warranty Expiration is less than 30 Days before Warranty Expiration

Who will Receive column : I have assigned it to me.

Is this condition right or should I change that? Please let me know.

Thanks in advance.

1 ACCEPTED SOLUTION

snehabinani26
Tera Guru

Hi Prudhvi,



It cannot be achieved in this way directly.



Create a Schedule Job(Script execution) place in the code to Glide in the table and fetch the record with the condition.


Now for each record trigger the event.



Define that event in registry.



Use this event in Notification when to send tab.



Eg ---



Schedule job script -- Run daily



var gr = new GlideRecord("cmdb_ci");


gr.addEncodedQuery("warranty_expirationRELATIVEGT@dayofweek@ahead@30");


gr.query();


while(gr.next()){


gs.eventQueue("event_name",gr,"","");


}



Hope this helps you.


View solution in original post

8 REPLIES 8

Hi Kyryl,



Could you please guide me in achieving this as I am quite to Servicenow?


Hi Kyryl, I got to understand what you were trying to explain. But, my recipients are not static, as you told above. The notification has to go CI Owner and there are different CI owners for each.


snehabinani26
Tera Guru

Hi Prudhvi,



Have you tried the option which I provided you.


Yaa, I am trying to do that Sneha. I think your answer would surely work. Thank you.