The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

copy chat history in the description of ticket using chat action

salu
Mega Guru

Hello,

I want to copy the chat history in the description of the field.can some one help me in this?

var desc='';

var notes = conversation.document.comments.getJournalEntry(-1);

  if (notes.indexof("[code]") == -1) {  

      var wrappedNote = "[code]" + notes + "[/code]";  

      notes = wrappedNote;  

  }  

// var na = notes.split("\n\n");                                          

// for (var i = 0; i < na.length; i++)

// {

// desc ="\n\n\n"+desc+na[i]+"       "+"\n\n\n";

// }

response.newRecord("new_call", {

  short_description: "",

  caller: conversation.document.opened_by,

  opened_by: gs.getUserID(),

  contact_type: "Chat",

  description: notes

});

But its hows like below.Is there way to show it as line by line

find_real_file.png

Thanks

Saranya

1 REPLY 1

PaulSco
Tera Expert

Saranya,



You can accomplish this by replacing this line:


var wrappedNote = "[code]" + notes + "[/code]";



With this line:


var wrappedNote = "[code]" + notes + "[/code]\n\n";



Please mark as answered if this correctly resolves your issue.