Can I make a script include process before a trigger rule

Jason Nicholas
Tera Expert

Hi

 

I have developed a process that uses a Script Include triggered by a business rule that checks active changes for alerting details.
On the change form I have added alerting tabs that the change raisers complete to ensure that any Incidents raised during the change window it checks and where the incident details match the details in the change alerting tab it reassigns those incidents to the team that are carrying out the change.

 

The issue I have is that we also have trigger rules set up for automated callout to support teams and where Incidents match the trigger rule criteria, these alerts generate a callout before being processed by the  change script.

 

Does anyone know if there is something that I can implement or change I can make to ensure the business rule /  script include processes the Incident before the trigger rule

 

Thanks 

4 REPLIES 4

AnubhavRitolia
Mega Sage
Mega Sage

Hi @Jason Nicholas 

 

You can use Scheduled Job to trigger Script Include and can put trigger condition to be X minutes/seconds before the Business Rule is trigger if Business Rule is triggered based on any Date/Time field value.

 

Else you can use Before Business Rule to execute it just before BR is executed.

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Hi Anubhav

 

Not sure I understand. The business rule triggers the script include on insert of a new incident

 

The trigger rule operates based on the creation of an Incident with specific criteria which triggers the 'On-Call: Assign by Acknowledgement' workflow.

 

The problem I have is that when a new incident is created I want the business rule to operate 1st before the trigger rule.

 

The issue I have is that the business rule is working and the Incident is correctly reassigning but the Trigger rule as already triggered a callout 

 

Trying to find a way to stop the callout when the alert is part of the change process (in other words it is not a genuine alert as it is caused by change)

 

Jason

Bert_c1
Kilo Patron

Hi Jason,

 

Please see:

 

https://docs.servicenow.com/search?q=Execution%20order%20of%20scripts%20and%20engines

 

that may help. A search there for "trigger rules" didn't turn up much for me, I'm not familiar with those. But maybe others here here are and will post.

Hi 

Thanks for the pointer, I guess the Trigger rule may fall under 'Escalation engine' in section 2. Unfortunately for me the business rule needs to be 'after' not before as it is triggered on the insert of a new incident.

 

Jason