I am trying to create a workflow to add a user to an AD group which I mostly have working. The problem I am having is deriving the group name from data I have in Fresh Service. All of my AD groups names have a shorthand code for a particular location. I would like to build an expression to map the long names we have in Fresh to my shorthand codes I have in AD.
Right now I am trying to build an expression using if statements, which works with the test button, but I get an error. I’m sure there has to be a better more maintainable way to do this within Fresh.
Invalid Syntax - One of its operands is invalid.
Here is a snippet of the code I have written.
if('{{ticket.ri_88_cf_location_to_access}}'=='Location 1', 'LOC1','') +
if('{{ticket.ri_88_cf_location_to_access}}'=='Location 2’, 'LOC2','') +
if('{{ticket.ri_88_cf_location_to_access}}'=='Location 3', 'LOC3','')