send survey after every 10 closed incident?

ash36
Kilo Contributor

I need to send incident survey on repeated interval of 10 incident closure. I tried setting the trigger condition based on Number ends with 0, but that's not a concrete solution. Has anyone done this before?

Help much appreciated, thanks !

27 REPLIES 27

I don't have a working script but can give you some suggestions. All you need here is a trigger condition that you can use to send out surveys. I also noticed that similar ideas have been proposed by others in this thread. The point is you want to track the total number of closed incident tickets and use it to trigger surveys; System Properties just happens to be a convenient place where we can persist the counter value.



  1. Add a BR
    Table: incident
    When: after insert/update
    Condition: [State] [changes to] [Closed]
  2. Add Script based on the following pseudo code:

var frequency = 10;   // send at every n closed tickets (set this to whatever frequency you want)


var propertyName = 'closed_incident_counter';   // your System Property name here


var counter = gs.getProperty(propertyName) + 1;   // read from System Properties and increment


saveCounter(propertyName, counter);   // immediately save incremented counter in System Properties


if (counter % frequency == 0) sendSurvey();   // send survey when counter is divisible by frequency



Instead of System Properties, you can also get counter value by using



var count = new GlideAggregate('incident');


count.addQuery('state', 3);   // set to your value of State = Closed here


count.addAggregate('COUNT');


count.query();


var counter = count.next() ? count.getAggregate('COUNT') : NaN;



Reviewing the OOB BR "task survey events" may also help.


roysaquicela
Kilo Contributor

Has anyone been able to actually get the survey to be sent out every "x" amount of times? The script doesn't seem to be working when trying to use it.


manish kale
Tera Guru

How can we Trigger the Survey only when it is the 10th resolved incident per user?.......Please mark it is supposed be per same user's 10th resolved incident. If anyone has idea. Please reach out on this?
Thanks in advance!!