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-04-2024 11:46 PM
In ServiceNow, the 'guest' user is typically used for unauthenticated users who are interacting with the system. When you see records in the metric_instance table (where assessment survey responses are stored) being updated by 'guest', it suggests that the survey responses are being submitted by users who are not logged into the system.
Possible Reasons for 'guest' User Updates:
- Public Surveys: The assessment surveys might be configured to allow responses from users who do not need to log in. This configuration permits the 'guest' user to submit responses.
- Survey Links: The survey links sent to users might be accessible without authentication, allowing anyone with the link to respond as 'guest'.
- Public Pages: The survey might be embedded in a public-facing page or portal where authentication is not required.
I hope my answer helps you to resolve your issue, if yes mark my answer helpful & correct.
THANK YOU
rajesh chopade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2024 01:41 AM
HI Rajesh,
thank u for the input. yes i understood that this might have happened because the user was not logged in when he responded.
But i have another issue where my After 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 03:54 AM
Your business rule looks fine but if you not getting the values in specific fields there are several reasons to consider.
1) Ensure that the fields u_escalation_from and u_task are accessible and that you have the necessary permissions to update these fields. This includes checking the read/write access controls (ACLs) for these fields.
2) Make sure the business rule is being executed as expected. You can add gs.log() statements to log information at various points in your business rule to ensure it's running and to check the values being set.
3)Consider the order of execution for business rules (before/after). If you have other business rules that run before or after the current one, they might be interfering with the update. Ensure there is no other logic that might be overwriting or nullifying the updates.
I hope my answer helps you to resolve your issue, if yes mark my answer helpful & correct.
THANK YOU
rajesh chopade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2024 05:35 AM
HI Rajesh,
the business rule works fine for other records. only when the assessment is updated by user 'guest', the issue occurs and only these 2 fields not updated but all the other fields are updated.