- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 03:47 PM - edited 10-18-2023 04:02 PM
Hi All,
I'm running into a problem with Virtual Agent Lite. When attempting to create a new incident, using the default ITSM `Report an Issue` topic provided out of the box, I get the message "I'm having technical issues and won't be able to continue this conversation." after it presents me with some possible support options related to my incident description. Looking in the logs, I see the below error, which seems to point to the line:
var vaFieldValidator = new global.VAFieldValidator();
I think is trying to get the validators from the sys_cs_field_script_validator. At this point I'm stuck on why it is failing. Thoughts?
Thanks,
Ben
Error Topic Node Script Error at topic [Request Catalog Item], at variable [vaInputs.__silent_ScriptedAction_16a1a697635b49049011bfb4b7300c06 ➚ ➚], for task [9756ad501b0e35104f756536604bcbd5], expression: [vaVars.previous_graph_node="Post Response___16a1a697635b49049011bfb4b7300c06 ➚";(function execute() {(function execute() {
var itemJson = JSON.parse(vaVars.itemJSON);
vaVars.validation_message = "";
var quesJson = itemJson.variables[vaVars.qIndex];
var type = quesJson.type;
var vaFieldValidator = new global.VAFieldValidator();
// If user doesnt want to proceed with the selected value and skips the question, the variable would be set to ""
var proceedWithDefaultValue = vaInputs.proceed_with_default.getValue();
switch (type) {
case 2:
case 6:
case 16:
var ans = vaInputs.question_text.getValue() || (proceedWithDefaultValue ? quesJson.display_value : "");
if (ans.trim().length === 0 && itemJson.variables[vaVars.qIndex].mandatory) {
vaVars.validation_message = gs.getMessage(You must answer this question);
break;
}
if (type === 2) {
itemJson.variables[vaVars.qIndex].value = ans;
vaInputs.question_text = "";
break;
}
var q = GlideappQuestion.getQuestion(itemJson.variables[vaVars.qIndex].sys_id);
var validresponse = q.validateRegex(ans);
if (validresponse) {
itemJson.variables[vaVars.qIndex].value = ans;
vaInputs.question_text = "";
} else if (!validresponse)
vaVars.validation_message = q.getValidationMessage();
break;
case 9:
itemJson.variables[vaVars.qIndex].value = vaInputs.question_date.getDisplayValue() || (proceedWithDefaultValue ? quesJson.display_value : "");
vaInputs.question_date = "";
break;
case 10:
itemJson.variables[vaVars.qIndex].value = vaInputs.question_date_time.getDisplayValue() || (proceedWithDefaultValue ? quesJson.display_value : "");
vaInputs.question_date_time = "";
break;
case 8:
var ans = (proceedWithDefaultValue ? quesJson.value : "");
if (vaInputs.question_reference)
ans = vaInputs.question_reference.getValue();
itemJson.variables[vaVars.qIndex].value = ans;
vaInputs.question_reference = "";
break;
case 1:
case 3:
case 4:
case 5:
case 18:
case 22:
var ans = (proceedWithDefaultValue ? quesJson.value : "");
if (vaInputs.question_choice) {
ans = vaInputs.question_choice.getValue();
ans = ans == no_data ? ' : ans;
}
itemJson.variables[vaVars.qIndex].value = ans;
vaInputs.question_choice = "";
break;
case 26:
var ans = vaInputs.question_email.getValue() || (proceedWithDefaultValue ? quesJson.value : "");
if (vaInputs.question_email.getValue() || ans == "" || vaFieldValidator.validateEmailAddress(ans)) {
itemJson.variables[vaVars.qIndex].value = ans;
vaInputs.question_email = "";
} else
vaVars.validation_message = gs.getMessage("This isnt a valid email address");
break;
case 27:
var ans = vaInputs.question_url.getValue() || (proceedWithDefaultValue ? quesJson.value : "");
if (vaInputs.question_url.getValue() || ans == "" || vaFieldValidator.validateURL(ans)) {
itemJson.variables[vaVars.qIndex].value = ans;
vaInputs.question_url = "";
} else
vaVars.validation_message = gs.getMessage("This isnt a valid URL");
break;
case 28:
var ans = vaInputs.question_ip_address.getValue() || (proceedWithDefaultValue ? quesJson.value : "");
if (vaInputs.question_ip_address.getValue() || ans == "" || vaFieldValidator.validateIPAddress(ans)) {
itemJson.variables[vaVars.qIndex].value = ans;
vaInputs.question_ip_address = "";
} else
vaVars.validation_message = gs.getMessage("This isnt a valid IP Address");
break;
case 31:
var ans = quesJson.default_value + ';
if (quesJson.default_value && proceedWithDefaultValue)
vaVars.request_for = ans;
else if (vaVars.request_for)
ans = vaVars.request_for;
itemJson.variables[vaVars.qIndex].value = ans;
}
if (!vaVars.request_for)
vaVars.request_for = gs.getUserID() + ';
var executeDataLookup = false;
var executeDynamicValue = false;
if (quesJson.data_lookup_ids && quesJson.data_lookup_ids.length != 0)
executeDataLookup = true;
if (itemJson.dynamic_value_variable_config && itemJson.dynamic_value_variable_config[quesJson.sys_id] && itemJson.dynamic_value_variable_config[quesJson.sys_id].length != 0)
executeDynamicValue = true;
if (executeDataLookup || executeDynamicValue) {
var helper = new sn_sc.CatalogConversationHelper();
vaVars.itemJSON = JSON.stringify(helper.executeVariableChangeHandlers(itemJson, quesJson.sys_id, executeDataLookup, executeDynamicValue));
} else
vaVars.itemJSON = JSON.stringify(itemJson);
// resetting the value of proceed with default incase validation fails
if (vaVars.validation_message.length !== 0)
vaInputs.proceed_with_default = false;
})()
;})();vaInputs.__silent_ScriptedAction_16a1a697635b49049011bfb4b7300c06 ➚ ➚=true;null;], error [TypeError: undefined is not a function. (Task.0da7c58c1b8af1104f756536604bcbdb; line 6)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 04:15 PM
Of course, right after I posted this, I had a realization that the problem was the VAFieldValidator script include was the problem. Reviewing it, the include had been deactivated. Once I activated it, my problem was solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 04:15 PM
Of course, right after I posted this, I had a realization that the problem was the VAFieldValidator script include was the problem. Reviewing it, the include had been deactivated. Once I activated it, my problem was solved.