Issue
As an example, when the Out of Box 'Open IT Ticket' topic creates a card for the incident, clicking on the incident number displays the record in /sp. Even if the Virtual agent is added to another portal, the record opens up in /sp.
This article explains how to use a scripted output to display a card and redirect the record to the desired portal.
Procedure
As an example, use Out of Box 'Open IT Ticket' topic.
- Open the topic in Designer.
- In Madrid, the topic uses Bot Response 'Card' to display the new incident
- Instead of using 'Card' add 'Script Output'
- Now in the Response Properties add the following:
- Name: Incident Card
- Script Output Type: Single-part
- Script Response Message:
(function execute() { var incident = new GlideRecordSecure('incident'); incident.get(vaInputs.create_incident); var title = { url: gs.getProperty('glide.servlet.uri') + '/' + gs.getProperty('sn_itsm_va.com.snc.itsm.virtualagent.portal_url') + '?sys_id=' + incident.sys_id + '&id=ticket&table=incident', label: incident.number }; var fieldList = ['category', 'assignment_group', 'short_description', 'state']; var cardRenderer = new global.VaRecordCardRenderer(true); var fields = cardRenderer.createFields(fieldList, incident); var html = cardRenderer.renderCard(title, fields); return html; })();
- Save the topic.
- Now go to sys_properties.list
- Find the following property: sn_itsm_va.com.snc.itsm.virtualagent.portal_url
- It must be set to sp. Change it to the desired portal.
Release
London and newer