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

Hi Rakesh,



The sys id you put in here is from is of the survey (Assessment metric type) ?


Rakesh Mamidi
ServiceNow Employee
ServiceNow Employee

Yes,itsassessment metric type


Hi Rakesh,

 

 var inc = new GlideRecord('incident');

 

  inc.get(lastTriggerID);

 

  var closedAt = inc.closed_at;

 

  var incident =   new GlideRecord('incident');

 

  incident.addNotNullQuery('closed_at');

 

  incident.addQuery('closed_at','>=',closedAt);

 

  incident.orderByDesc('closed_at');

 

 

You have mentioned  'closed_at', Is it a custom field on incident table?

I'm also looking for solution for the same issue.

Please guide me.

 

Thanks,

Thejaswini

gyedwab
Mega Guru

Hi Ashish,



It seems like what you're trying to do would be accomplished using Survey Trigger conditions?



Survey Trigger Conditions - ServiceNow Wiki



If you select "Trigger Randomly" and put in a 10% probability, it should send your survey to 1 in 10 incidents.


ash36
Kilo Contributor

As far as I am aware, the % here sets the probability that the survey will be sent or not when the condition is met. For example if I set it to 25%, a probability of 25% does not mean, that for 4 incidents 1 survey will be generated. It means that for every single incident (where the conditions are met), there is a 25% chance that the survey will be generated.
Sending 1 in 10 is a frequency and not probability.



Thanks!!