Regarding creation of notification when catalog task is not being closed after 1 week

Shreya3
Tera Contributor

how we can built from scratch the code for creating notification to be sent to technology Ci Owner manager and cc technology ci owner and suppport group if catalog task has not yet been closed after 1 week. And also need help for creating notification to be sent to technology Ci Owner manager and cc technology ci owner and suppport group to create p1 incident and then send email if catalog task has not yet been closed after 2 weeks . please help on this. I have created  2 event registry  , 2 email notification and 1schedule job. but in schedule job i am not able to put proper code for both of the scenarios can anybody help on this asap, as I am new to this.

26 REPLIES 26

shikhatyagi
Kilo Sage

Hi @Shreya3 

 

You can create Daily scheduled job to check if catalog task is not in closed state (Compare days between task creation date and current date) and if days difference is more than 7 days then trigger notification through gs.eventQueue()

 

Please Mark this Helpful and Accepted Solution if it solves your issue.

 

Thanks & Regards,

Shikha Tyagi

Rajesh Chopade1
Mega Sage

Hi @Shreya3 

 

Here you having the solution for your ask:

https://www.servicenow.com/community/itsm-forum/trigger-a-notification-after-10-days-of-task-creatio...

 

Please mark my answer correct and helpful if it helps you to resolve your issue.

 

thank you

AakashGarg1678
Kilo Guru

Hi @Shreya3,
Hope you are doing well.

 

I tried to find the solution for your scenario or requirement and give the perfect solution in one go.

 

Solution Proposed

As a solution, you need to follow just 3 small steps to achieve the task or requirement: -

  1. Create a new record in "Schedule Job (sysauto)" Table that will continuously run on a daily basis and check for the open tasks which have passed 1 week of time. This job will trigger the event created by you.
  2. Create an Event in "Event Registry" Table.
  3. Create a new Notification based on an Event that you'll create.

Let me know if this suits you or I need to do the following steps and implement it on my Personal Developer Instance, so that you will be able to get the solution as soon as possible.

 

If you find this answer/solution/suggestion as helpful to your question asked or meet with your requirement, you can mark this solution/answer/suggestion as helpful, and correct.

 

Thanks

Aakash Garg

ServiceNow Developer

Hi Akash can you showcase me schedule job  exact code which will work for both scenario because i am not able to do and i am creating schedule job that is running on demand not on daily basis. table is sc_task. i have created event registry and notification.