Please help with notification advanced condition

Jessica28
Tera Guru

Hello,

We have a Catalog Item with a variable named 'Priority.' The variable contains 'Low Priority' and 'High Priority.

Need help with Advance condition if value is High Priority, then send the high email. Otherwise, send the Low Priority notification.  

Here what I have, but it did not work.  Thank you

 

if (getPriority == 'low_priority') {
answer = true;
} else {
answer = false;
}

1 ACCEPTED SOLUTION

Hi @Clara Lemos ,

I was using the following code, but that did not works:

var getPriority = current.variables.select_Priority;

if (getPriority == 'low_priority') {
answer = true;
} else {
answer = false;
}

View solution in original post

4 REPLIES 4

Clara Lemos
Mega Sage
Mega Sage

Hi @Jessica28 ,

 

Is "getPriority" the name of your variable? If yes, try using current.variables.getPriority  in your script instead of getPriority .

 

If that helps please mark my answer as correct / helpful!
And if further help is needed please let me know

Cheers

 

 

Hi @Clara Lemos ,

I was using the following code, but that did not works:

var getPriority = current.variables.select_Priority;

if (getPriority == 'low_priority') {
answer = true;
} else {
answer = false;
}

Gary Fawcett1
Tera Guru

Is this running in on an update busines rule?  Set on relevant table.  My example uses incident.

Business rule.jpg

 

Then in the advance section, create a script like this, that fires off an event.  The create email notifcations to respond to that event?

(function executeRule(current, previous /*null when async*/) {

    if(current == 'Low_priotity')
    {
        // Create an Event
    }

})(current, previous);


Thanks...Gary

Hi @Gary Fawcett1 ,

This is running on the Notification.  I was able to get it to works with the following condition.  Thank you for suggestion.

var getPriority = current.variables.select_Priority;

if (getPriority == 'low_priority') {
answer = true;
}