logo

NJP

Customize Incident Display Card

Import · Jul 03, 2020 · article

Hi Guys,

I'm here again with the another article on the future of ServiceNow 'Virtual Agent'. We had a requirement to display only the inputs provided by User along with the Incident Number and they wanted a little bit classic look. So again we made use of Simple HTML to fulfill the requirement.

First, Let's see how OOTB 'Open IT Ticket' topic displays an Incident card :

imageimage

Step 1 : Navigate to Collaboration > Virtual Agent > Designer

image

Step 2 : Search for an OOTB topic block 'Create Incident' and open it.

image

Step 3 : Click 'Duplicate'

image

Step 4 : Give the topic a unique name and click 'Save'

image

Step 5 : Click 'Edit Topic Flow' on the properties page of newly created topic

image

Step 6 : Locate the node 'Display incident' and delete it

image

tep 7 : Add a bot response 'Text' between 'Incident created' and 'End' nodes

image

Step 8 : Give it a unique name and click the script section of 'Response Message'

image

Step 9 : Replace the OOTB script with the below script and click 'Save'

var incidentDetails = newGlideRecord("incident");

incidentDetails.get(vaInputs.create_incident);

var html = '

';

html += '

';

html += '

';

html += '

';

html += '

' + incidentDetails.number + '
Alright, I\'ve opened your incident and a technician will be assigned.
Urgency
' + incidentDetails.getDisplayValue('urgency') + '
Short description
' + incidentDetails.short_description + '
';

image

Step 10 : Locate the 'Incident created' node and delete it.

image

Congratulation, You have created a customized Incident Display Card. Now all you need to do is add your custom topic block to the Topic.

Follow the Steps given here, to add our customized topic block to the Topic. Once you perform the steps mentioned in this link you can see the result.

image

ServiceNow Certified System Administrator

Dxsherpa Technologies Pvt. Ltd.

View original source

https://www.servicenow.com/community/virtual-agent-nlu-articles/customize-incident-display-card-how-to-read-the-docs-virtual/ta-p/2310499