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

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

Hey @Paul Curwen thanks so much, it worked like a charm! You're a star!

 

have a good one -Parker

Hi
This works only in UI16, it is not working for SOW view(only while MENTION scenario)
It started showing calculated names always in SOW. Any help here?

@Paul Curwen Thank you so much. This was very helpful. Curious? If I enter my own name, this new functionality I added doesn't display. Any suggestions on making sure this new functionality displays even if I am trying to @mention myself? Thank you for your time.