How to set contact type as Virtual agent or walk-in as per the type of incident?

Priyanka Shind1
Kilo Expert

Hello All,

We are on Rome version and using virtual agent live chat as well as walk up modules.

When agent is creating an incident from agent workspace for an interaction it should set contact type as Virtual Agent when type is chat however, it should set contact type as walk-in when type is walk up.

From KB I got to know that create incident UI action needs to be modified for this.

UI action is written on Interaction table, I have used below script however, its showing Virtual agent as contact type for walk up as well. Can anyone please correct this?

var inc = new GlideRecord("incident");
inc.initialize();
inc.caller_id = current.opened_for;
inc.short_description = current.short_description;
if(type =='chat')
{inc.contact_type = "6";}
if(type =='walk-up')
{inc.contact_type = "5";}
action.openGlideRecord(inc);

Please help to fix this one.

 

TIA

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

the value of type on iteration is different, it doesn't have the -

find_real_file.png

 

So your code should be something like below

var inc = new GlideRecord("incident");
inc.initialize();
inc.caller_id = current.opened_for;
inc.short_description = current.short_description;
if(current.type =='chat')
{inc.contact_type = "6";}
if(current.type =='walkup')
{inc.contact_type = "5";}
action.openGlideRecord(inc);

 

-Anurag 

 

 

-Anurag

View solution in original post

2 REPLIES 2

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

the value of type on iteration is different, it doesn't have the -

find_real_file.png

 

So your code should be something like below

var inc = new GlideRecord("incident");
inc.initialize();
inc.caller_id = current.opened_for;
inc.short_description = current.short_description;
if(current.type =='chat')
{inc.contact_type = "6";}
if(current.type =='walkup')
{inc.contact_type = "5";}
action.openGlideRecord(inc);

 

-Anurag 

 

 

-Anurag

Jason Shone
Kilo Contributor

Did this get fixed?

Am looking at the proposed solution but:

a) changing the ui action Create Incident is not working (Rome)

b) not sure why inc.contact_type is set above as a numeric when values are text, e,.g. walk-in

 

I believe the fix is actually in the UI Page incident_confirmation, not in the ui action?

 

see https://community.servicenow.com/community?id=community_question&sys_id=4210e36edb1be300b1b102d5ca961993