Virtual Agent Incident Creation Source

dwoods
Giga Contributor

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

1 ACCEPTED SOLUTION

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

LinkedIn

View solution in original post

4 REPLIES 4

Mark Roethof
Tera Patron
Tera Patron

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

LinkedIn

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.

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

LinkedIn

really appreciate the help. You pointed me in the right direction. In this case the "Open IT Ticket" actually has a condition instead of a script. I created a duplicate of this ticket and then I was able to edit.

 

find_real_file.png

 

By clicking "Add Field" I can then edit the source value.