Assessment records updated by user 'guest'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2024 11:37 PM - edited ‎08-05-2024 01:42 AM
we send out some assessment surveys to end users. when they respond, the responses are saved in metric response table. But i can see some records are updated by a user named 'guest'. What could be the reason. we do have a user named 'guest' in user table. but that email id is not used by anyone. Beacuse of this update, another after insert business rule actions are interrupted.
business rule didn't update few fields of the escalation record fields.
i have a business rule which creates a record in Escalation table whenever a record is created in response table that matches my conditions.
it has updated all other fields except u_escalation_from and u_task. couldnt identify the reason.
Any idea on this ?
(function executeRule(current, previous /*null when async*/ ) {
// here in asmt_metric_result table , it treats both records of one assessment group as one record only hence cant take out string value of remark separately from BR but can from background script. so using table : asmt_assessment_instance_question
var assess = new GlideRecord('asmt_assessment_instance');
// assess.addQuery('assessment_group', current.assessment_group);
assess.addEncodedQuery('assessment_group=' + current.assessment_group + '^u_assignment_group=18b2f297db556a40c744fafc0f9619a2^ORu_assignment_group=5c4ceb60db04aa000856f4331f9619be^ORu_assignment_group=982c1db7db41eb080e1c9c18db9619eb'); // "IT Anytime Support" "Global System L2 Support" "Global Network L2 Support Team"
assess.query();
if (assess.next()) {
var escalationInfo = new GlideRecord('u_escalation_information');
escalationInfo.initialize();
escalationInfo.u_escalation_type = 'escalation';
escalationInfo.u_channel = 'Survey';
escalationInfo.u_task = assess.trigger_id.number;
escalationInfo.u_escalation_from = assess.trigger_id.caller_id;
escalationInfo.u_ticket_owner_group = assess.trigger_id.assignment_group;
// additional fields
escalationInfo.u_sd_owner = 'a3a7f9b7dbe9851098f39c6dd3961995'; // Prasanna Kumar P
escalationInfo.u_escalation_to = 'f5a7752adb7c09d4b67a0f2dd396198e'; // Sundar Muruganantham
escalationInfo.u_category = 'd3fba6f41b860e104278dbd1f54bcbe6'; //User Dissatisfaction
escalationInfo.u_impact = 'Medium'; // medium
escalationInfo.u_ticket_owner_group = '18b2f297db556a40c744fafc0f9619a2'; // IT AnyTime Support
var qu = new GlideRecord('asmt_assessment_instance_question');
qu.addEncodedQuery('category=c219849fdb492240c744fafc0f9619d6^instance.assessment_group=' + current.assessment_group + '^metric=923b7516db8576000856f4331f961921');
qu.query();
if (qu.next()) {
escalationInfo.u_details = qu.string_value;
}
escalationInfo.insert();
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2024 05:45 AM
Your script looks fine, I will suggest you here -
Use gs.log() for debugging to log values and identify where the issue might be occurring.
Check are you getting values in following:
assess.trigger_id.number
&
assess.trigger_id.caller_id