copying the survey response on the work notes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2016 06:09 AM
Hi All,
My requirement is update the work notes of a change request with the survey response (Risk Assessment questionnaire) for the same change. How can this be done?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2016 08:53 AM
Hi Kunal,
A much simpler option would be to add the 'Task Assessment > Task' related list onto the Change Request form, so that the responses can be seen from the related list.
Nevertheless, a Business Rule could be created on the Task Assessment[task_assessment] table to do this. You would need to start by looking up all of the Survey Responses[survey_response] that are associated with the Survey Instance[survey_instance] for the current Task Assessment. Once you have those, you can loop through them to capture the question and response for each one, and add that as a Work note to the Task for the current Task Assessment.
Enjoy!
-Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2022 09:37 AM
Please Provide the script for that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2017 12:21 AM
You can create a business rule on survey instance table when state is complete.
Script:
var parent_record = new GlideRecord(current.trigger_table);
if(parent_record.get(current.trigger_id)) {
var survey_response = new GlideRecord('asmt_metric_result');
survey_response.addQuery('instance',current.sys_id);
survey_response.orderBy('assign_to_order');
survey_response.query();
var notes = '';
while(survey_response.next()) {
notes = notes + survey_response.instance_question.getDisplayValue() + ' ' + survey_response.string_value + '\n';
}
parent_record.work_notes = notes;
parent_record.update();
}