Skip to main content
Solved

Custom Notifications - where field "contains" or is "like"

  • August 30, 2022
  • 3 replies
  • 140 views

I’ve found the article on how to put some nifty customisations on the Sysaid notifications, and it allows us to do a “not” and “equals” check - e.g.:

#if( ${Status}==”In Progress” )

#if( ${Solution}!="" )

However, I was wondering - does the system support “contains” or “like” operators?

 

I was hoping to do something along the lines of:

#if( ${Description} like "*forgot my password*" && ${Description} like "*SystemX*" )

    <p>Did you Know? You can hit the ‘forgot my password’ link in SystemX to reset it? View the How-To article here: <a>link</a></p>

#end

Best answer by james.reynolds

Thank you.
 

This is an example of what worked:

    #if($Description.indexOf("telephone") > 0)
        contains telephone
    #end

 

Here’s an alternative method which might be useful

    #set($myString = ${Description}) 
    #if($myString.indexOf("telephone") > 0)
        contains telephone
    #end

3 replies

Maayan Karstaedt
SysAider
Forum|alt.badge.img

Hi @james.reynolds 

The notifications are written in Apache Velocity language check the supported operators here: 

https://velocity.apache.org/engine/1.7/user-guide.html#relational-and-logical-operators

Cheers,

 

 


  • Author
  • New SysMate
  • Answer
  • September 19, 2022

Thank you.
 

This is an example of what worked:

    #if($Description.indexOf("telephone") > 0)
        contains telephone
    #end

 

Here’s an alternative method which might be useful

    #set($myString = ${Description}) 
    #if($myString.indexOf("telephone") > 0)
        contains telephone
    #end


Maayan Karstaedt
SysAider
Forum|alt.badge.img

Thanks @james.reynolds for sharing the love!!