HelpSpot Help Desk Software | HelpSpot Blog | HelpSpot Support

Trigger for duplicate custom fields


#1

I am trying to generate a private notification that triggers when a custom field entry equals an existing custom field. For example, a tracking number customer field has a value of “1”. Then another ticket is submitted which also has a tracking number that is equal to “1”. In this situation I would like a private message to be generated. I am not sure what the PHP code is to reference previous values of a customer field. Does anyone have any ideas pertaining to my issue?


#2

Hi Scott,

You won’t be able to do this with the triggers as they don’t search other tickets in that manner. You could do it pretty easy with SQL with something like:

SELECT xRequest, COUNT(*) as total FROM HS_Request WHERE Custom7 = 1 GROUP BY Custom7 HAVING total > 1