Sent/Recieved Emails in Ticket Conversations widget

Simon Christens
Kilo Sage

Hi Community

Is there anyone in here who have tried to incorporate the "Sent/Recieved Emails" functionality into the Ticket Conversations widget?

The obvious upside for this is that if you do not copy email content into comments its still possible for the end user to see mails back and forth.

Regards

Simon

37 REPLIES 37

Uhm well exactly there actually...

If you copy everything I've posted (except for the line below, which is at the top of the other post) and put it under this line of code:

record.stream = $sp.getStream(options.table, record.sys_id);

It should work fine imo, since as far as I can tell its all standard SN stuff.

You're additional comments should be visible too though, not sure were that setting is...
Since I'm 'using' the additional comments 'element' for adding the emails.

 

I was not able to find the proper place to put this code. I do not have the record.stream line in the OOB Ticket Conversations widget, nor the clone i made that we are utilizing on our Service Portal. 

 

What widget is the code added to ?

 

Thilo M
Kilo Contributor

Thanks you helped me a lot!

I just had to change record.* with data.* and it worked.

 

Thanks for sharing this Chris! I've done something similar to this in the past for other purposes - I think it was a customer who didn't want both work_notes and comments. So I disabled comments but modified this to show the work_notes in the portal.

The only things that I'd add here is

1. Life is easier if you create a separate variable containing prettified JSON of record.stream to prettified JSON in the widget and put it in the log while you are developing (actually I prefer to generate an event). This allows you to "see" the structure of the $sp.getStream() output and allows for easier modification.

2. You are sorting on a.sys_created_on_adjusted. This is actually localtime and the format depends on user preferences and locale so it won't always sort correctly. You should sort on a.sys_created_on which is always UTC ISO8601 essentially which will always sort correctly. Of course the widget itself will use sys_created_on_adjusted to display the date/time.

Has anyone implemented this as of late? I can't find the exact line Chris is talking about. 

 

Will mark as helpful etc.