Can we use IF-statements with criteria "Begins With" or "Contains" in Reply templates/Signatures/CEP?

When working with IF-statements in Reply Templates, Service signatures or in the CEP I often miss the possibility to use the criteria Begins with or Contains.

Currently I have searched through the documentation but I only finds example in how to use

  • Equals [[IF:condition="Blue"]]
  • Not Equal [[IF:condition!="Blue"]]

But does there exist any undocumentated way to use criterias like Begins with [[IF:conditionBeginsWith"Blue"]] or Contains [[IF:conditionContains "Blue"]] ?

Or is it possible for me to use Criteria LIKE in a way like [[IF:condition="Blue%"]] or [[IF:condition="%Blue%"]]

I am trying to create category depedning signatures similar to this post:

https://community.superoffice.com/en/the-parliament/forum/Rooms/topic/consultancy-support/consultancy/use-category-based-reply-template-in-service/

But I want a better way so my IF-statement continues to work even the customer adds more service categories in the future.

If I could use something like [[IF:ticket.category.fullname="Blue%"]] or [IF:conditionBeginsWith"Blue"]] it would be solved. Then I would know the parent category when .category.fullname = "Blue/Lås - Blue/DuoCity lås"

So do R&D have some secret ways to do this? Or anyone else knows?

RE: Can we use IF-statements with criteria "Begins With" or "Contains" in Reply templates/Signatures/CEP?

Hi Gustav,

Unfortunately I dont have any secret ways to accomplish this. It does not look like our parser supports these criterias. If you need a more flexible way of ensuring that it will work even if customer adds more categories, I would look into option to add this logic in screen instead.

By: Michel Krohn-Dale 23 Sep 2021

RE: Can we use IF-statements with criteria "Begins With" or "Contains" in Reply templates/Signatures/CEP?

Hi Gustaf,

Perhaps you could consider adding a (hidden?) request field which allows you to use the available logic parser-logic in a better way. Combine that field with a trigger script (on category change for example) and organize that field (text-wise) so it can do what you would like to do. You cannot influence the output of ticket.category.fullname, but you can influence the content of your own service field (in whatever way you would prefer). Link the logic to the selected category and perhaps you can make things work as required :)

By: Bas Kreijveld 23 Sep 2021

RE: Can we use IF-statements with criteria "Begins With" or "Contains" in Reply templates/Signatures/CEP?

Yes, I ended up adding  a-trigger script (on saving a request) which updates a CatogoryMaster field (ticket.x_ej_category_main_parent). I also let the screenchooser for the View ticket screen execute the same code instead of updating all old tickets with this new logic.

 

In my reply template template I use these:

[[DECODE: ticket.x_ej_category_main_parent,"Info","", ticket.x_ej_category_main_parent]]

[[DECODE: ticket.x_ej_category_main_parent,"Garanti","+46 512-30 10 75","Info","+46 512-79 77 00","Kundservice","+46 512-30 10 73","Kvalitet","+46 512-30 10 75","Montagesupport","+46 512-30 10 71","+46 512-79 77 00"]]

 

But for the R&D, I wish you to add this kind of feature. It should really be helpfull if the Parser-IF conditions could do a little but more stuff, like saerch with begins with, include, ends with etc.

By: Gustaf Cullin 23 Sep 2021