Firing a notification using a background script.

Emily7
Kilo Explorer

Hi SN developers!

I am trying to fire a notification when a priority 1 incident occurs. Here is the screen shots.

find_real_file.png
It works correctly when I create a new priority 1 incident or update the incident priority using "Update" button.

However, when I create a backgroud script and update the priority to 1 but the notification doesn't fire. Is there any advice? Thank you in advance.

find_real_file.png

find_real_file.png

find_real_file.png

 

 

find_real_file.png

1 ACCEPTED SOLUTION

Phuong Nguyen
Kilo Guru

Hi Emily,

In your background script, you have gr.setWorkflow(false); this prevents business rules and workflows from running, hence your business rule does not fire the event.

 

Regards,

Phuong

If you find my suggestions helpful, please mark it as correct or helpful to help out others as well 🙂 

View solution in original post

5 REPLIES 5

Phuong Nguyen
Kilo Guru

Hi Emily,

In your background script, you have gr.setWorkflow(false); this prevents business rules and workflows from running, hence your business rule does not fire the event.

 

Regards,

Phuong

If you find my suggestions helpful, please mark it as correct or helpful to help out others as well 🙂 

Thanks! It worked. 

Jaspal Singh
Mega Patron
Mega Patron

Hi Emily,

 

Strange. It should work. Can you confirm the recipient list once & make sure it has some values, also try chcking the Send to Event Creator flag to True & see the result.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of resposne.

valarmathi_kann
ServiceNow Employee
ServiceNow Employee

Hi Emily,

 

May I know why do you need ' gr.setWorkflow(false);' in your script? Can you please remove this and check?