Issues with Virtual Agent Case Card, State defaults to draft, record number link takes me to esc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 03:20 PM
So I am encountering a couple of issues.
1. When the HR Case is created on the virtual agent, it is being created in Draft, why is that? How can I fix this?
2. When I click on the record number hyperlink on the case card, it takes me to the esc portal, how can I route this to take me to our other portal instead (hrhelp)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 09:36 PM
Hi @Dario Idrovo1 ,
We found a solution to this. It is correct that you cannot change the url for a card and direct users to a different portal, but we found that you can disable the link entirely. We then used a link bot response immediately after the card to direct the user to the record on our custom portal.
To disable the link, go to script include "VaRecordCardOutput". Line 39 is the subtitle in the card (this is the link) and line 40 is the sys_id of the record for the link.
Make the subtitle value an empty string to remove the link from the card. We also commented out the sys_id field as we don't need it.
Then use the Link bot response to link to the record. This lets you build the link per your requirements, so you can go to any portal instead of just SP.
This is what you end up with:
This also works in Slack, where you cannot use "VaRecordCardRenderer" to create a scripted card to control the link.
Please refer following thread:
Approach 2:
- 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;
})();
- In above code gs.getProperty('sn_itsm_va.com.snc.itsm.virtualagent.portal_url') replace with your system property name and try it.
- And update these field names to HR field names in the script incident.sys_id+'&id=ticket&table=incident',
label: incident.number - 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.
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
