Chat Incident Auto Populate

ctsmith
Mega Sage

When an incident is created from chat, it does not auto populate the first name, middle name, and last name (it only populates the caller_id) of an incident as it normally would when an incident is created by other means aside from a chat session.   It seems g_chat is limited in what it can do.   Is there a way to add the first/middle/last names from the chat action for creating an incident from chat?

Thanks!

Chris

1 ACCEPTED SOLUTION

This was able to pull out the necessary information just by querying on the sys_user table:



var chatinfo = new GlideRecord ("sys_user");


  chatinfo.get(g_chat.getChatQueueUser());




g_chat.fire(LiveEvents.WINDOW_CREATE_DOCUMENT,


  'incident',


  {


      caller_id : g_chat.getChatQueueUser(),


      short_description: g_chat.getProperty('short_description'),


      u_reported_source: 'Chat',


  state: '2',


  incident_state: '0',


  u_email_address: chatinfo.email,


  u_phone_number: chatinfo.phone,


  u_incident_location: chatinfo.location


}


);


View solution in original post

18 REPLIES 18

Awesome!   Nice job!  



Special mention to my coworker jeffruzz who did the scripting for Connect/Collaborate when we ditched legacy chat.


kennetholesco
Mega Expert

I believe we are using the Connect Chat. here's what i see in the lefthand navigation.


find_real_file.png


My above script is for a chat queue action that came with legacy chat.   If you type in chat, you may see it if you're using Legacy.



find_real_file.png


We did have to make a change in location from the script I included above, though.   We're testing out Jakarta, and we updated location to this:



location: chatinfo.location


//old value:


//u_incident_location: chatinfo.location


Hi ctmath2,



No I cannot see that. Mine's from Collaborate > Administration > Actions



I tried the script below unfortunately it does not work


location: chatinfo.location


//old value:


//u_incident_location: chatinfo.location



find_real_file.png