Survey notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2016 02:35 AM
Hi, I have to send a notification to the user if he didnt respond to the survey notification, in 2 days. We use both surveys and am looking for a way to achieve this. Can someone please help me in this?
Ex: Lets say an user's request is resolved. When it is resolved, the out of the box notification will send an email along with survey. If he fails to respond to that survey, I again need to send a new notification (with some added text) to the user asking to complete the survey.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2016 03:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2016 04:04 AM
Hi Dinesh,
You are going in right direction however you just need to follow the below steps for getting this done.
1. Create a scheduled job on asmt_assessment_instance(assessment instance table).
2. Create new field on the above given table called counter.
3. Scheduled job will run every 2 hour and qualification in the glide query will be (assessment instance is not closed & counter ==1 && updated is before 2 days however
( you will have to consider the one extra condition if user has tried filling the survey then survey instance record will be updated so what will happen if survey is about to be expired the next day then two days update condition will fail so you will have to build such query to accommodate your further requirement).
4. if condition matches then send the created event to the queue with help of gs.eventQueue('2nd_survey_notification',other parameter). once it will trigger event is attached to the notification and it will fire. and also on the new field counter will be set to counter=counter +0; it will be used in scheduled job query.
5. You are done with your requirement.
Hope this helps.
Regards,
Atul Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2016 05:21 AM
Hi Atul,
Thanks for your reply. I have some doubts in your reply.
1. Do I need to write a business rule to update the counter field every time a survey is sent?
2. Do I need to use gs.eventQueue .... in the scheduled job? I guess yes but wanted to confirm.
3. If you are asking me to mention the condition in the scheduled job then can I remove the condition set in the notification? It doesn't make sense right.
Thanks,
Dinesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2016 05:41 AM
Hi Dinesh,
1. You dont need to write business rule for that. You need to write the same business rule code in scheduled job. just go through the scheduled jobs in service now.
system definition > scheduled jobs >Create new scheduled jobs with type Automatically run a script of your choosing. > write your code in run script section.
2. if all condition matches then you will send a event to the queue and it will trigger associated notification what you would have created.
3. you are correct, you can remove.
Hope this helps.
Regards,
Atul Kumar