- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2023 12:16 AM - edited 06-19-2023 10:52 AM
On the greetings topic I created a script variable in order to check our KB for any open Promo/Outage Messages. This could be repurposed to any other item such as incidents or changes.
(function execute() {
var count = new GlideAggregate('kb_knowledge');
count.addEncodedQuery('kb_knowledge_base=ENTER KB SYS_ID HERE^workflow_state=published');
//count.addQuery('assigned_to', vaInputs.user); // something like this will be required if you use incident/change tables
count.addAggregate('count');
count.query();
if (count.next()) {
var countfinal = count.getAggregate('count');
}
return countfinal;
})();
If there are open outages, you are redirected to a specific topic designed to relate your interaction to the outage if the user confirms. If not, then depending on if there is a live agent online or not the users are presented with one of two messages. I disabled all the code in the Greeting card and are instead using the Send Topic Picker card instead. If you use the Greeting card instead you will need to remove the sendtopicpicker line or you will get a duplicate topicpicker and enter return gs.getMessage(message); instead after the close else if bracket.
(function execute() {
var message;
if(vaVars.count != 0){
vaSystem.switchTopicById('ENTER OUTAGE TOPIC SYS_ID HERE');
}
if(!vaSystem.isLiveAgentAvailable() && vaVars.count == 0){
message = 'Hi ' + [vaInputs.user.first_name] + '! I am your Virtual Assistant and all systems are currently operational. At this time there are no live agents staffed to assist. Please enter a short description of your issue or you can click on the Show Me Everything button for further options. Please note that should a ticket be required it may sit unassigned until the next business day. ';
return vaSystem.sendTopicPickerControl(gs.getMessage(message)); // remove if Greeting card is in use
}
else if (vaSystem.isLiveAgentAvailable() && vaVars.count == 0) {
message = 'Hi ' + [vaInputs.user.first_name] + '! I am your Virtual Assistant and all systems are currently operational. Please enter a short description of your issue or you can click on the Show Me Everything button for further options.';
return vaSystem.sendTopicPickerControl(gs.getMessage(message)); // remove if Greeting card is in use
}
// return gs.getMessage(message); //add if Greeting card is in use
})()
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2023 12:16 AM - edited 06-23-2023 09:50 AM
Since this will require a custom greeting topic, you will also need to update your setup topic to point to this to your custom greeting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2023 12:16 AM - edited 06-23-2023 09:50 AM
Since this will require a custom greeting topic, you will also need to update your setup topic to point to this to your custom greeting.