How to use a Business Rule Query in a System Property

matthew_hughes
Kilo Sage

I'm working on a Business Rule that uses the below query in the if statement:

matthew_hughes_0-1778512588731.png

((current.u_external_auditor_sox_control == true || current.u_sox_control == true) || (current.u_cbp_tier == 'Tier A' || current.u_cbp_tier == 'Tier B') || current.u_supports_crown_jewels == 'Yes' || (current.u_bia_confidentiality == 'severe_1' && current.u_bia_integrity == 'severe_1'))
 
So I'm wanting to put this massive query into a system property called 'lbg.ama.privileged.access.rating.query'
 
I was just wondering if anyone knows how I would need to do this so that it makes my business rule look tidier.

 

2 REPLIES 2

Tanushree Maiti
Mega Patron

Hi @matthew_hughes ,

 

You can use the system property to store static content ( in your case -its a collection of conditions).

For your use case, store the encoded query in a system property and whenever modification is needed, update it.

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Nishant8
Tera Sage

Hello @matthew_hughes , I'm not sure whether creating a property to store the massive query is a good idea as you may have to track/update the two objects, if required. Nevertheless, as as first step, you can convert your plain query to ServiceNow encoded query without current (you can simply do it from the List and copy the query from there) and store in the property- I have encoded your query as per my understanding, however  please verify once 

u_external_auditor_sox_control=true^ORu_sox_control=true^ORu_cbp_tierINtier_a,tier_b^ORu_supports_crown_jewels=Yes^ORu_bia_confidentiality=severe_1^u_bia_integrity=severe_1

As a next step, fetch the same query and change the if condition as below:

if (GlideFilter.checkRecord(current, privilegedAccessRating,true))