Imhow to send notification ehen sla is about breach in 48 hours

srikanthgun
Giga Contributor

Hi

Can any one please guide me on logic to trigger condition 

In Request item any sla is attached - when sla  is about to breach with in 48 hours I want to notify assigned to 

I wrote flow but no luck

I can't add trigger condition task.table is Ritm 

Thanks in advance

70980.jpg

 

2 ACCEPTED SOLUTIONS

Tanushree Maiti
Giga Patron

Hi @srikanthgun 

 

You can do it by either using Flow Or Scheduled Job.

 

Option1: Using Flow

  • Trigger: Record Updated on task_sla.
  • Conditions: Stage changes to in progress AND Has Breached is false.
  • Action: Use Wait For Duration to wait until 48 hours before Planned End Time.
  • Action: Send Email to Task.Assigned to

Option2 : Using scheduled Job

 

  • Navigate to: System Scheduler > Scheduled Jobs > Scheduled Jobs.
  • Create New: "AutomaticallyTickle_SLAs_48hr".
  • Run: Daily (Frequency set as per your requirement).

 

Sample code/Not tested:

 

var grSla = new GlideRecord('task_sla');

grSla.addQuery('has_breached', false);

grSla.addQuery('stage', 'IN_PROGRESS'); // Set query as per your requirement

grSla.addQuery('task.sys_class_name', 'sc_req_item');

// validate if planned end time is within 48 hours from now

grSla.addQuery('planned_end_time', '>=', gs.daysAgo(0));

grSla.addQuery('planned_end_time', '<=', gs.daysAgo(-2));

grSla.query();

 

while (grSla.next()) {

    gs.eventQueue('sla.48hr.warning', grSla.task, grSla.task.assigned_to, gs.getUserID());

}

 

Associated Notification: 

 Register sla.48hr.warning in the sysevent_register table.

  • Table: Request Item
  • When to send: Event is sla.48hr.warning.
  • Who to send to: Event parm 1 contains recipient (assigned_to).
  • Content: Customize your email subject/body
Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

View solution in original post

Hello @srikanthgun, If you want to be specific to Requested Item then you can select as Task.Task Type (as below) in addition to your existing filter conditions:

Nishant8_0-1778429074511.png

 

Regards,

Nishant

 

View solution in original post

4 REPLIES 4

Tanushree Maiti
Giga Patron

Hi @srikanthgun 

 

You can do it by either using Flow Or Scheduled Job.

 

Option1: Using Flow

  • Trigger: Record Updated on task_sla.
  • Conditions: Stage changes to in progress AND Has Breached is false.
  • Action: Use Wait For Duration to wait until 48 hours before Planned End Time.
  • Action: Send Email to Task.Assigned to

Option2 : Using scheduled Job

 

  • Navigate to: System Scheduler > Scheduled Jobs > Scheduled Jobs.
  • Create New: "AutomaticallyTickle_SLAs_48hr".
  • Run: Daily (Frequency set as per your requirement).

 

Sample code/Not tested:

 

var grSla = new GlideRecord('task_sla');

grSla.addQuery('has_breached', false);

grSla.addQuery('stage', 'IN_PROGRESS'); // Set query as per your requirement

grSla.addQuery('task.sys_class_name', 'sc_req_item');

// validate if planned end time is within 48 hours from now

grSla.addQuery('planned_end_time', '>=', gs.daysAgo(0));

grSla.addQuery('planned_end_time', '<=', gs.daysAgo(-2));

grSla.query();

 

while (grSla.next()) {

    gs.eventQueue('sla.48hr.warning', grSla.task, grSla.task.assigned_to, gs.getUserID());

}

 

Associated Notification: 

 Register sla.48hr.warning in the sysevent_register table.

  • Table: Request Item
  • When to send: Event is sla.48hr.warning.
  • Who to send to: Event parm 1 contains recipient (assigned_to).
  • Content: Customize your email subject/body
Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

srikanthgun
Giga Contributor

Hi @Tanushree Maiti  
Thanks for the approach - the flow will trigger for all Tasks exp: Problem, Inc, RITM etc.
I want to trigger for only Request Item - Request type is XYZ.

any logic can you guide me to add condition 

Thanks

Hello @srikanthgun, If you want to be specific to Requested Item then you can select as Task.Task Type (as below) in addition to your existing filter conditions:

Nishant8_0-1778429074511.png

 

Regards,

Nishant

 

Hi @srikanthgun 

 

Refer: Create a flow with an SLA Task trigger 

 

 

 

  • Add an If flow logic block.
  • Use the data pill picker to select Trigger -> Task SLA -> Task and dot-walk to find Catalog Item.
  • Set the condition: [Task SLA -> Task -> Catalog Item] is [XYZ]

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: