need help to optimze glideagrregate script for survey trigger

suryakalam
Tera Contributor

i want to trigger a customer satisfaction servey to every 5th incident caller,when every 5th softwre category incident get resolved,

1 ACCEPTED SOLUTION

Matthew_13
Mega Sage

Hi My Friend,

Yep — thats doable, and your right to be thinking about performance.

If the requirement is send a CSAT survey for ~every 5th resolved Software incident dont use a GlideAggregate(count) on the Incident table at resolve-time. That’s heavy and it can also misfire when multiple incidents resolve at once.

What most people do and I have done instead is a 1-in-5 selection that doesnt require counting at all fast + consistent. You only evaluate it when the ticket transitions to Resolved and if its a “hit,” you trigger the survey.

If you literally need the exact 5th / 10th / 15th in sequence, you’ll want a small counter record not an aggregate on incidents otherwise you’ll run into performance + race conditions.

 

@suryakalam - If help you answer; Please mark Solution Accepted and Thumbs Up

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron

@suryakalam 

unless you share what you tried and where are you stuck, how we would know what's not working.

share those details

miftikhar20
Kilo Patron

Hi @suryakalam ,

 

Please see the following community discussion, its similar to your requirement:

Solved: Survey Frequency - Sent out when every 5th item is… - ServiceNow Community

 

If my response helped, please mark it as the accepted solution so others can benefit as well.