...
Code Block |
---|
<mail_script> // bw - since this survey is meant to be frameless, strip the nav_to part of the url. var url = event.parm2.replace("nav_to.do?uri=", ""); url = url.replace(/%20/g, '+'); url = url.replace(/%26/g, '&'); template.print('<table><tr><td align="center" width="300" bgcolor="#0F4D92" style="background: #0F4D92; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; color: #fff; font-weight: bold; text-decoration: none; font-family: Helvetica, Arial, sans-serif; display: block;"><a href="' + url + '" style="color: #fff; text-decoration: none;">Click here to take the survey</a></td></tr></table>'); </mail_script> |
Manager Data Access for Reporting
- A number of reports were requested and provided as gauges, then added to Survey->Overview
- The
survey_reader
role was granted to a new role group called "SURVEY_READER"; all current assignment group managers added to this role group. - The Survey application was tweaked to limit visibility of Masters, Conditions, etc to hide them from
survey_reader
. - For convenience, an "Incident Responses" view was created with interesting dot-walks for this survey's data (
task_survey
table) - For even more convenience, a CSV download link was created to enable quick download of this survey's data.
Follow-Up Alert
It was decided that to implement this feature, a task would be created whenever a respondent requests a follow-up (as offered in the survey). This was accomplished by an "after" business rule on the survey_response
table:
- Rule Type: run on server after Insert or Update
- Condition:
current.instance.survey.name.match(/Customer Satisfaction Survey/g) != null && current.question.question_text.match(/follow up/g) != null && current.answer.match(/Yes/g) != null
- Script:
Code Block // // open a task (grab instance name, then get the task survey, then the incident, then the assignment group) var instance = current.instance.sys_id; var survey = new GlideRecord('task_survey'); survey.addQuery('instance', instance); survey.query(); if(survey.next()) { newtask = new GlideRecord('task'); newtask.short_description = 'Customer Satisfaction Survey Follow-Up' newtask.parent = survey.task; newtask.assigned_to = survey.task.assignment_group.manager; newtask.cmdb_ci = survey.task.u_component; newtask.description = 'A follow-up has been requested for a resolved incident. Please liaise with the Contact of the Parent task.' newtask.insert(); }