Business Rule needs to trigger only Monday to friday at 9AM.

Servicenow de11
Tera Contributor

Hello,

 

In the users table we have one business rule and that business rule will create an incident whenever the user is Inactive.

Now our requirement is  incident will create only at Monday - Friday at 9Am only.

How to write a schedule job to trigger that business rule only at the Mentioned time.

Can anyone let me know how to achieve this.

 

Thanks in Adavance

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Servicenow de11 

 

Might be helpful

 

https://www.servicenow.com/community/developer-forum/how-to-call-a-schedule-from-a-business-rule-to-...

https://www.servicenow.com/community/developer-forum/running-a-business-rule-from-an-scheduled-job/m...

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron
Tera Patron

@Servicenow de11 

both the things are different.

Scheduled job is used when you want to perform an action at particular time i.e. weekly, daily, monthly

Business rule is something which will run whenever database operation is done

what's your business requirement?

Since you already have a BR please use GlideDateTime class and check day of week and the time and based on that create incident

what script did you start with and where are you stuck?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi  Ankur,

Our business requirement is ,We are experiencing an issue with system generated hardware recovery incidents. To be specific, these are for terminations that are generated due to account inactivity, etc. They seem to be created at random times, mostly during off hours and are causing us to breach SLA's.

Can we force the system to generate these tickets during work hours so that we can prevent these breaches?

 

We have one existing business rule and it will create incidents if the user status is inactive.

Now that business rule will trigger only on business days to prevent SLA breaches.

Servicenowde11_0-1706008964304.png

 

Thanks