Add multiple conditions inside a condition builder

Anirban Roy
Mega Guru

Hi,

I have a condition builder with 2 separate conditions:

Criteria 1:

find_real_file.png

 

Criteria 2:

find_real_file.png

 

 

How to merge the result of both the criteria via AND operator.

Regards,
Anirban

8 REPLIES 8

Maik Skoddow
Tera Patron
Tera Patron

You forgot to mention, that both conditions refer to different tables (Condition 1 = Incident & Condition 2 = Change). Therefore you cannot combine them, because a condition builder can be built on one table only.

The only way to have both tables in one condition builder is to create a database view (see Documentation or Youtube Videos), but without any further details, I cannot tell you how build it.

The problem statement is created using a business rule on incident table.

The major constraint on combining both the criteria 1 and criteria 2 is that, when we combine the criteria 2 with criteria 1, then the criteria 2 won't be evaluated separately.

 

To simplify, let's say, Criteria 1 has 3 checks(A.B.C) and Criteria 2 has 2 checks(X.X' || Y.Y'). I want [A.B.C] . [X.X' || Y.Y'] which is same as saying A.B.C.X.X'  || A.B.C.Y.Y', however in service now condition builders, if we combine, it would become A.B.C.X.[X' || Y].Y'

Note: using '.' for AND operator and '||' for OR operator.

I suppose the condition builder is not able to map such complex conditions.

But you could script your condition in a Script Include and use the "Condition" field in the "Advanced" tab for invoking the Script Include, like

new MyComplexConditionHelper().check(current)

 

Yes, definitely scripted way would be easier way to handle such cases. Thanks @Maik Skoddow 

I was curios if we had something like condition or criteria sets, so that it calculates each set separately and deduces the final query.