Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2023 10:15 AM
I am not able to generate a survey using the below ui action server-side script. The UI action needs to be created on the cmdb_ci_business_app table. Please advice for any corrections.
var typeSysID = 'c1d2fef9dbe3a5909cbf198d139619be';//The sys_id of the metric type or survey definition to generate assessments or surveys for.
var sourceRecordID = '';
var userID = current.getFieldValue('it_application_owner').sys_id; //The sys_id of the user in the cmdb_ci_business_app table and who is the survey respondent.
var result = new SNC.AssessmentCreation().createAssessments(typeSysID, sourceRecordID, userID);
var asmtGR = new GlideRecord("asmt_assessment_instance");
asmtGR.get(result.split(",")[0]);
asmtGR.setValue('trigger_table','cmdb_ci_business_app');
asmtGR.update();
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2023 10:27 AM
How about below:
var typeSysID = 'c1d2fef9dbe3a5909cbf198d139619be';//The sys_id of the metric type or survey definition to generate assessments or surveys for.
var sourceRecordID = '';
var userID = current.it_application_owner//The sys_id of the user in the cmdb_ci_business_app table and who is the survey respondent.
var result = new SNC.AssessmentCreation().createAssessments(typeSysID, sourceRecordID, userID);
var asmtGR = new GlideRecord("asmt_assessment_instance");
asmtGR.get(result.split(",")[0]);
asmtGR.setValue('trigger_table','cmdb_ci_business_app');
asmtGR.update();
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2023 10:27 AM
How about below:
var typeSysID = 'c1d2fef9dbe3a5909cbf198d139619be';//The sys_id of the metric type or survey definition to generate assessments or surveys for.
var sourceRecordID = '';
var userID = current.it_application_owner//The sys_id of the user in the cmdb_ci_business_app table and who is the survey respondent.
var result = new SNC.AssessmentCreation().createAssessments(typeSysID, sourceRecordID, userID);
var asmtGR = new GlideRecord("asmt_assessment_instance");
asmtGR.get(result.split(",")[0]);
asmtGR.setValue('trigger_table','cmdb_ci_business_app');
asmtGR.update();
Please mark my response as correct and helpful if it helped solved your question.
-Thanks