how to add incident details in Agent Chat

Sironi
Kilo Sage

Hi,

What I need to do is the following: 

User starts a chat with a live Agent. From Agent Workspace window agent assists the user and creates an INC. When the INC is created my customers would like a link to the created incident to be pushed in to the Active Chat window. Something like "I have created an Incident to help with your issue, please see INCXXXXXXXX for further details."  And then when the INC number is clicked it redirects the user to the Created INC. 

Currently in Agent Workspace it looks like the following when you create an INC for the user, but doesn't push anything in to chat. 

 

  

find_real_file.png

 

 

1 ACCEPTED SOLUTION

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

 

The agent who works on this chat and create incident can copy paste the incident number and enter it into chat window. Then the end user will see a ticket card as below which is OOB.

find_real_file.png

find_real_file.png

 


Thanks,
Ashutosh

View solution in original post

27 REPLIES 27

balanagaraju
Mega Contributor

Yes, I agree on that ServiceNow should provide this functionality as OOTB solution. We can ask with HI Support to include this as an enhancement in future releases.

 

If you are creating the incident through the UI Action then no need to create the business rule. You can put the below code in the UI Action server side script to push incident details into the conversation.

 

var getIncidentNumber = new GlideRecordSecure('incident');
getIncidentNumber.addQuery('sys_id', 'Sys ID of Incident Created');
getIncidentNumber.query();
if(getIncidentNumber.next()){
  var message = getIncidentNumber.number;
  sn_connect.Conversation.get(current.channel_metadata_document, current.channel_metadata_table).sendMessage({
   body: message,
   system: false
  }); 
}

 Thanks,

Bala

I can't get this to post a message to the conversation, even if I just test with plaintext 😕

sn_connect.Conversation.get(current.channel_metadata_document, current.channel_metadata_table)
	.sendMessage({
		body: 'TEST',
		system: false
	});

I'll try again next week but let me know if you have any thoughts in the meanwhile.

I get how it works from the Conversation API (which oddly - I take is out of date and - doesn't show the 'table' parameter under .get and also shows 'field' instead of 'system' under .sendMessage) but I can't figure out why it wouldn't be working...

I think may be issue with the scope, did you try it running in Global scope ?

Thanks,

Bala

Yeah, I'm only in Global scope (don't have access to the Application Picker).

I tried in my personal instance to create a custom UI action to send incident details into conversation and seems it is working fine

It is working in New York & Orlando when I tried to create this UI action in global scope.

What is the version you are working to send the incident details to conversation ?

find_real_file.png

Thanks,

Bala