Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Event Rule filters using "less than", "greater than", "less than or is", or "greater than or is" make an incorrect comparison when the value is numeric - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Event Rule filters using "less than", "greater than", "less than or is", or "greater than or is" make an incorrect comparison when the value is numeric
KB0713117

Event Rule filters using "less than", "greater than", "less than or is", or "greater than or is" make an incorrect comparison when the value is numeric


1469 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Issue

Symptoms


Event Rule filters using "less than", "greater than", "less than or is", or "greater than or is" make an incorrect comparison when the value is numeric. 


Steps to Reproduce: 
================= 
1. Create a new event rule 
2. Check the "Ignore events that match this filter" checkbox 
3. Set the filter to: 
    some_value is greater than or is 2000 
4. Set the event rule to active and save 
5. Create a number of events to test. 

Set the Additional information to {"some_value":"100"} (this value will need to be updated in each additional event 150, 200, 201, 300, 1000, 2000, 2001, 50)

6. Wait for event management to process the events. 


The rule ignored the events with the following values: 201, 300, 2000, 2001, 50, but only two of those events should have been ignored. 

Release


All

 

Cause


The the event filters for Additional Info performs a comparison using a string value only.  It does not work with numeric value. If you're using numeric value it will not perform the correct comparison.

Work Around


1.The work around is to use the Event Management, Advanced Scripts

2.The "EvtMgmtCustom_PostTransformHandler" script include could be modified to perform the evaluation.

3. Below is an example script to ignore events with the "num_value" < 200

---start

(function postTransformHandler(event, origEventSysId){
    gs.log('PostTransformHandler custom script is active'); 
// Make any changes to the alert which will be created out of this Event
// Note that the Event itself is immutable, and will not be changed in the database
// event.setValue('source', 'New Source'); 
 
var additonal_info = event.getValue("additional_info");
 
var jsonInfo = JSON.parse(additional_info);
var number = jsonInfo.num_vaule;
var my_field = jsonInfo.my_field;
 
gs.log("Test " + jsonInfo.num_value + " " + jsonInfo +" " + my_field);
 
if (my_field === 'test' && number <200)
return false;
else
return true;  
 
----end
 
 

 

 

Results


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.