Can you have both a OOC and Advance condition script on an email notification

Peter Williams
Kilo Sage

Good Day,

i am trying to configure an email notification to go off the following information.

 

PeterWilliams_0-1702058983519.png

 

However, the Variables condition for Current Location isn't working and i will need to script this out.

So is it possible to have the OOC seen above + Advance condition running for the Current location like

 

var loc = current.variables.current_location.getDisplayValue();

 

if (loc == 'Toronto'){

answer = true;

}

answer = false;

 

1 ACCEPTED SOLUTION

i found the solution that will work

if(current.variables.current_location == 'Calgary' && current.u_revision_version.changes() && current.order_guide.name =='Changes'){
    answer=true;
}else{answer = false;}

View solution in original post

6 REPLIES 6

This is interesting, can you explain more?

Community Alums
Not applicable

Sure, for example in my experience so far (like8++ yrs) there are always some discrepencies between dev, test & prod. Admins tend to change or add choices which makes the condition builder expression invalid if you use such a choice made on dev let say. Also it depends when to who and what email you want to send. You can handle this with standard notifications as you did it, but (at least in the sense of creating and managing these) I prefer using events. If you open the task table (I think incident table have better example) you can find business rules managing exactly that - firing events on a given conditions where more complicated logic is involved. And you can use one BR to handle all of your events with if/if else/else or swith - depending on your requirements.

Not to mention that if your sys_id's are different of your cat items then you are in trouble for sure. To avoid such cases I add my own properties which I just get and use instead of hardcoded values (like if(current.name == gs.getProperty("my_super_incident")) - where my_super_incident is either the sys_id of the cat item or the name - but easily changable via simple property.