send survey after every 10 closed incident?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2017 12:56 PM
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 !
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2017 09:04 AM
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.
- Add a BR
Table: incident
When: after insert/update
Condition: [State] [changes to] [Closed] - 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2017 01:32 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2022 02:48 AM - edited ‎10-17-2022 02:49 AM
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!!