Conditional Warning Based on a Keyword


In this tutorial, we would like to introduce you to a way of controlling the workflow of a group based on keywords. This can be particularly useful if a ticket is to be treated in a special way if a certain keyword occurs.

In our example, this keyword is “KLX908P” and it is used in customer email like this:

Bildschirmfoto vom 2024-12-10 15-33-48.png

We might add this code into the receive script of the email box where we expect the customer's message:

var keyword="KLX908P".toLowerCase();
if(task.description.toLowerCase().indexOf(keyword)>-1){
   task.description=helper.insertOnTop(task.description, "<div style='border: 3px solid red;'>SPECIAL CASE - "+keyword+"!</div>");
}

Then the ticket will show the extra red note on top of the description:

Bildschirmfoto vom 2024-12-10 15-43-32.png