Can Work Notes @mention include user id?

phenkry
Tera Contributor

Hi everyone,

in the @mention function in journal fields, the matching User Names pop up as choices. However, there is no way to distinguish between who is who for users with identical names:

phenkry_0-1695894705633.png

 

Is it possible to add the User ID in the results list, so we can see who is who? Something like this:

phenkry_1-1695894901914.png

 

Or is there some other way to determine who is who?

I would have expected this to be a quite common requirement but can't find any post or info about it.

 

Thanks in advance -Parker

1 ACCEPTED SOLUTION

Paul Curwen
Giga Sage

It can be done: 

 

Update the sys_user name dictionary item. The calculated item can do the same checks for @mention and display a different calculated value there.

Example...

 

 

// At the end of the calculated value script, add the below

if (gs.getSession().isInteractive()) { // only do for interactive sessions
  if (gs.action.getGlideURI() != "") {
    if (gs.action.getGlideURI().getMap() != '') {
      if (gs.action.getGlideURI().toString().startsWith('api/now/form/mention/record/')) { // @ mention is being used
        current.user_name; // return user_id field - change this combo to be anything you would like
      }
    }
  }
}

 

If helpful please mark as Helpful/Correct

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

View solution in original post

6 REPLIES 6

Martin Bujold
Tera Contributor

Also worked for me as well! 😁
Thank you very much @Paul Curwen!

Would you know if it's possible to put some information on a second line like the original ask?
Something like...

John Smith (smij)
Developer

John Smith (smjo)
Assitant Director

I was able to add the "User ID" in the parenthesis and other attributes of the sys_user record but would like to display the "Title" under the name.

Any idea if that could be done?

Thank you for your help!
Martin

GJaganM
Tera Contributor

How to do it in Agent workspace? i want to same information like department, User ID  in @ mentions in worknotes.

 

Is it possible ?

 

Thanks in Advance