How to find if the incident is not updated in last 5 business hours in servicenow in flow desinger

nayanmule
Tera Guru

Hi,

 

I need to find out the incident which is not updated in last X business hours in servicenow.

I want to use it in a flow designer .

 

Any help will be appreciated

 

Thanks,

Nayan

5 REPLIES 5

saraw925
Tera Contributor

Hi @nayanmule,

 

It is better to use a Business Hour Schedule since ServiceNow doesn't have a built-in encoded query for business hours on 'sys_update_on' as it uses calendar time which does not respect business hours, holidays or weekends. 

 

1. You may create a schedule in [cmn_schedule] or use an existing schedule if already defined. 

2. Scheduled is recommended here to trigger the flow than using Record Updated.

3. To calculate the exact business hours you may use a Script after the trigger. 

  • Takes your number of work hours (default is 24)
  • Make a date/time set to right this moment. 
  • Subtracts that many business hours from "now" to skip nights, weekends, holidays etc to calculate the cut-off time

4. You may use this cut-off time in Look Up Record where the Table is Incident (Condition : for the active incidents where nobody worked on them since the cut-off time)

 

If my response helped please mark it correct. 

 

Best Regards,

Sarah