- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 05:29 AM
Hi,
I have a requirement to run a business rule when either of the following scenarios occur on the Incident table:
1)
Record is inserted AND
Service offering is 1,2,3,4 or 5
2)
Record is updated and Service offering changes
Service offering changes to 1,2,3,4 or 5 but was NOT previously 1,2,3,4 or5
I.e., don't run if the previous Service offering was one of the 5, even if the change is to another of the 5. Only run when changing to one of these 5 and the previous isn't one of them.
My problem is that to write that in the condition field would be too long. I therefore want to generate the filter in a script include and then call it. I've done this before with reference qualifiers however unsure how to get it working with a BR condition.
Does anyone have any examples of where they have done something similar?
Steven
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 05:58 AM
Hi @Steven Watts2 ,
Create BR with condition insert or update, annd check additional logic in insert and update block as below
Change service_offering with your actual service_offering field backend value and also verify if its 1 or "1" while comaparing values
if (current.operation() == "insert" && (current.service_offering =1 ||current.service_offering =2|| current.service_offering =3 || current.service_offering =4 ||current.service_offering =5)) {
//do the following
}
else if(current.operation() == "update" && (current.service_offering.changes()) && (previous.service_offering !=1 ||previous.service_offering !=2 || previous.service_offering !=3 ||previous.service_offering !=4 ||previous.service_offering !=5)){
//do the logic
}
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 05:58 AM
Hi @Steven Watts2 ,
Create BR with condition insert or update, annd check additional logic in insert and update block as below
Change service_offering with your actual service_offering field backend value and also verify if its 1 or "1" while comaparing values
if (current.operation() == "insert" && (current.service_offering =1 ||current.service_offering =2|| current.service_offering =3 || current.service_offering =4 ||current.service_offering =5)) {
//do the following
}
else if(current.operation() == "update" && (current.service_offering.changes()) && (previous.service_offering !=1 ||previous.service_offering !=2 || previous.service_offering !=3 ||previous.service_offering !=4 ||previous.service_offering !=5)){
//do the logic
}
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 06:01 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 03:01 AM
Hi @Steven Watts2 ,
did it work?? if so,
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 03:03 AM
Hi @Hemanth M1
Apologies, completely forgot to respond. I had to make a couple of tweaks but yeah this worked, thanks for the assistance.
Steven