- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2020 01:09 PM
We have a virtual agent setup for one of our service portals. When an incident is created it sets the source of that incident to "Virtual Agent". Is it possible to customize that based on the portal the agent was used in? We are adding additional portals and would like to know it came from a chat in a specific portal.
Thanks
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2020 09:15 AM
You mean the Open an Incident which executes a Topic Block Create Incident?
If so...
The Topic Block executes Script Include VACreateINCUtil. This Script Include contains amongst others:
var incGr = new GlideRecord("incident");
incGr.initialize();
incGr.setValue("caller_id", caller);
incGr.setValue("urgency", urgency);
incGr.setValue("short_description", short_description);
incGr.setValue("description", description);
incGr.setValue("contact_type", "virtual_agent");
incGr.setValue("cmdb_ci", cmdb_ci);
if (!gs.nil(universalgr))
incGr.setValue("universal_request",universalgr.sys_id);
incDetails.sysid = incGr.insert();
So this Script Include causes on purpose that the contact_type is set to virtual_agent.
So it's up to you what to do. Do you want to use this topic block? Then you have to update the incident after it got created. Or maybe you want to create your own topic block, with own updated scripting? All up to you.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2020 10:13 PM
Hi there,
Can you share how you are creating the incident? And what specifically do you want to have changed? Do you have multiple sources added as choices, and you want one of those as source? Or something else? It should be fairly easy to update the Record Action Utility to provide the source you are after, or maybe you are using the Script Action Utility with a GlideRecord?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2020 07:43 AM
Thanks for the reply. I am just using the out of the box "Open an Incident" topic. I do have the various sources created and would like to select one of those.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2020 09:15 AM
You mean the Open an Incident which executes a Topic Block Create Incident?
If so...
The Topic Block executes Script Include VACreateINCUtil. This Script Include contains amongst others:
var incGr = new GlideRecord("incident");
incGr.initialize();
incGr.setValue("caller_id", caller);
incGr.setValue("urgency", urgency);
incGr.setValue("short_description", short_description);
incGr.setValue("description", description);
incGr.setValue("contact_type", "virtual_agent");
incGr.setValue("cmdb_ci", cmdb_ci);
if (!gs.nil(universalgr))
incGr.setValue("universal_request",universalgr.sys_id);
incDetails.sysid = incGr.insert();
So this Script Include causes on purpose that the contact_type is set to virtual_agent.
So it's up to you what to do. Do you want to use this topic block? Then you have to update the incident after it got created. Or maybe you want to create your own topic block, with own updated scripting? All up to you.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2020 09:06 AM