Connect chat - How to inject CLICKABLE links trough connect action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2017 05:37 AM
Hi,
i ´ve been trying for a few days to inject a link on the connect chat by using a connect action that i have created. The goal is to send the chat survey link on the chat once it is closed.
1st i have tried generating a simple html string, and successfully injected the link on the chat, but the link was not clickable, it was just a normal text. Below is the snippet of my attempt:
var gcm = new GlideCollaborationManager();
gcm.sendSystemMessage(sys_id, surveyLink)
The ONLY way that i have found to do this, after researching a lot, is by using the "SNC.LiveFeedApi()". I am able to inject the clickable link in the chat this way, BUT, once you click the link, it is rendered inside ServiceNow backend UI, instead of service portal. I don ´t have any control over the generated link, it seems to be generating correctly but once you click the link, it adds "nav_to.do?uri=/" to the url, causing the link to be rendered inside SN backend UI.
*NOTE: as per Hi support, GlideCollaborationManager() and SNC.LiveFeedAPI() are not public, so there is no documentation available.
Below is the complete code inside my connect action:
/* Get chat Survey Link for the customer */
// The survey is only triggered when the chat is completed
gs.sleep(2000); // timer for the survey generation
// Pulling the survey record, to get it ´s link
var gcm = new GlideCollaborationManager();
var grSurveyInstance = new GlideRecord("asmt_assessment_instance");
var surveyLink = "";
var hrPortalURL = "hrportal?id=take_survey&instance_id=";
var message = "Help us improve by taking our short satisfaction survey related to your recent chat request!";
grSurveyInstance.addQuery("task_id", conversation.queueEntry.sys_id);
grSurveyInstance.query();
// Setting up the user ´s survey instance URL
if(grSurveyInstance.next()){
surveyLink =gs.getProperty('glide.servlet.uri') + hrPortalURL + grSurveyInstance.sys_id;
var id = conversation.document.group;
new SNC.LiveFeedApi().addMessage(message + "\n\n\n" + surveyLink, id);
}
Do anyone know how can i make the link render correctly in any other way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2017 04:37 PM
Hi Mohan,
Is this a business rule? Anyways, it would be easier to understand if you would update the chat_queue_entry table with the incident after insert.
The error is this:
ch.document_id = 'Incident:' +item.number;
What you only need to update the document_id field is the sys_id of the incident.
Kindly try this out:
var inc = new GlideRecord("incident");
inc.initialize();
inc.caller_id = conversation.document.opened_by;
inc.short_description = conversation.document.short_description;
inc.contact_type = 'Chat';
inc.work_notes = desc;
var incident = inc.insert();
current.document = 'incident';
current.document_id = incident;
current.update();
Regards,
Carl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2017 07:45 AM
Hi Carl,
Thanks for your response. I have glide through the chat_queue_entry table and inserted the document ID & table information but after that every chat activity becomes a activity log of incident. Is there any way that we can restrict the chat activity falling into ticket logs. I have tried with business rule on the 'live_group_profile' table with a condition of 'Table' changes to 'incident', and set 'abort action' but not working. Do you have any idea.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2018 11:39 AM
Hello Dave,
I have used your suggestion, and it works fine. But when I want build a custom message with a link it doesnot work.
As sample, I have done following:
var linkUrl = "www.google.com";
var linkName = "Google"
var msg = "@L["+linkUrl+"|"+linkName+"]";
new SNC.LiveFeedApi().addMessage(msg, id);
What I got on my message it ´s "www.google" instead Google. Any idea why?
Thanks in advance,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2018 02:39 AM
Hi All,
In my organization, we are using connect chat however I have a query regarding to the limits of its first message posted to SD. From User end, User is able to type long text but at SD end only 200 characters from the message is displayed and rest is shown as ...... I have highlighted that part in yellow colour. Is there any way to extend its field length. so that SD will able to see all the content whatever has been posted by user.
Please see the attached screenhot.
Is anyone know what to do & could you please let me know how to achieve that.
Quick reply much appreciated!
At End user end, who has posted 400 characters .
At SD end, where we have received 400 charaters however just it doesn't display at SD end's window