Where is e.name coming from on Ticket Conversation widget on Service Portal?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 04:56 AM
On the <h4 class="timeline-title">{{::e.name}}</h4> part of the HTML code, where is e.name coming from and how can we replace it with just the First Name of the agent that commented on the ticket instead of full name.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 05:21 AM
It comes from $scope.data.mergedEntries in the widget's controller. Ultimately that looks like it's populated by the response from the history api.
This has these fields available:
element
initials
login_name
name
sys_created_on
sys_created_on_adjusted
sys_id
user_sys_id
value
Name seems to be the most useful item here.. OOB this displays the user's first and last name which I'm guessing is because that's the display column for the user table. If you have the same configuration you could just try splitting that string and pulling out just the first name.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 05:30 AM
Do you have an idea on how we can manipulate that e.name string? Can we just refer to e.name on the Client Script and do text replace using javascript?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 06:02 AM
Look at the mergeStreamEntries function in the controller starting around line 87.
That's where that object gets populated with it's data. Your best bet will probably be to use the standard javascript split and/or replace functions for each entry in there.
You may also be able to use those same js functions inside the expression in the template (the {{::e.name}} part) but that's not really best practice.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 07:29 PM
Okay, we are trying to do it via the Client Script, what is the variable being returned that contains the e.name value (we plan to pass that variable to our js replace function first.) Is it the variable "entries"?