Adding more identification to user name in worknotes and comments

Jim16
Tera Contributor

Is there a way to modify the user name shown at the top of a worknote or comment for incident by adding more information? For example maybe adding the company of the user - John Anderson (Eagle LLC)?

2 REPLIES 2

Marcos Kassak
Kilo Sage
Kilo Sage

Hi @Jim16,

 

Without customization, I don't think there is a way to handle this - other than editing the Name field in the Users table.

 

I had an idea of creating a new field with the combination of First Name + Last Name + Company and setting it as the Display of the Users table, but that did not work as expected...

 

I've seen people customizing by disabling an ACL and editing the history table but I would not go that deep because you'll likely face some problems on upgrades:

 

https://www.servicenow.com/community/sysadmin-forum/changing-the-user-name-tagged-in-the-work-notes-...

 

 

If you found my answer helpful or correct ✔️ in any way, please don't forget to mark it to help future readers! 👍

 

--

 

Kind regards,


Marcos Kassak
Solution Consultant  🎯

Sumanth16
Kilo Patron

HI @Jim16 ,

 

The Activity formatter is pulling from the History [sys_history_line] table, which stores the audited changes (actually copies them from the audit table on-demand, but no need to get into that here), and it stores the value of a user's name field ([sys_user].name) in a string value called user_name on the History table.



All you need to do is edit the calculated value on the dictionary entry for column 'name' on the table [sys_user] to show the userid you want displayed.   I've (actually) tested this time, and it works.



**Keep in mind that this will not affect existing entries in the History table, those strings have already been written from the previous user name values.   However, you can clear (delete) the existing records from the History table and they will be regenerated from the audit table records.   So unless you clear the history table to have it rebuild the history lines, you will see the previous values (name only) for existing entries, and the new values (name + userid) for new entries.

 

 To clear your history entries requires clearing two tables:   [sys_history_line] and [sys_history_set].   The easiest way is to open each from the "Tables" module, and then click the button "Delete All Records".

 

Please mark my answer as helpful/correct if it resolves your query.

 

Thanks & Regards,

Sumanth Meda