Use an OR condition in a business rule

An OR condition can be added to any query part within a business rule.

An OR condition can be added to any query part within a business rule with the addOrCondition() method. The example below shows a query for finding all the incidents that have either a 1 or a 2 priority. The first addQuery() condition is defined as a variable and is used in the OR condition.
var inc = new GlideRecord('incident'); 
var qc = inc.addQuery('priority','1'); 
qc.addOrCondition('priority','2');
inc.query(); 
while(inc.next()) { 
  // processing for the incident goes here 
}
The following script is a more complex example, using two query condition variables doing the equivalent of (priority = 1 OR priority = 2) AND (impact = 2 OR impact = 3). The results of the OR condition are run with two variables, qc1 and qc2. This allows you to manipulate the query condition object later in the script, such as inside an IF condition or WHILE loop.
var inc = new GlideRecord('incident'); 
var qc1 = inc.addQuery('priority','1');
qc1.addOrCondition('priority','2'); 
var qc2 = inc.addQuery('impact','2'); 
qc2.addOrCondition('impact','3'); 
inc.query(); 
while(inc.next()) { 
  // processing for the incident goes here  
}