0
1. Open the topic in Designer.
2. In Madrid, the topic uses Bot Response 'Card' to display the new incident
3. Instead of using 'Card' add 'Script Output'
4. Now in the Response Properties add the following:

Name: Incident Card
Script Output Type: Single-part
Script Response Message:
<code>(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;
})();​</code>

5. Save the topic.
6. Now go to sys_properties.list
7. Find the following property: sn_itsm_va.com.snc.itsm.virtualagent.portal_url
8. It must be set to sp. Change it to the desired portal.
Redirect the Virtual Agent Bot Response Card record URL to a portal other than /sp portal ServiceNow
admin Changed status to publish December 19, 2023