System added work notes show user's name instead of "system"

johnsonjohn
Tera Contributor

Hello - I'm not sure if this is a bug or just expected behavior.  I couldn't find anything about it in the community, so I'm just going to assume it's expected.  Whenever a work note is entered by the system (for example, through a business rule), the activity log in the INC or TASK shows the name of the person that triggered the work note.  So someone reading through an activity log will assume that someone manually entered that note, even though it's really system generated.  Is there any way to change this so that the work note says something like "system" or "Service Now" -- anything but an actual person's name?  Thanks in advance.

1 ACCEPTED SOLUTION

Also, you may want to experiment with this if that doesn't work:

current.comments.setJournalEntry('Thank you for contacting TEST', 'admin');

Using that as an example.

Oh and also...I see A issue....

You're basically double-dipping with the impersonate....by having:

var myUser = gs.getSession().impersonate("71478d6c4f649e002de27bcd0210c74a"); //sysID for FJ

and then having this

gs.getSession().impersonate(myUser);

later in the script...so you're causing some issues with the impersonate function.

You'd need to just set the myUser variable to the sys_id of the user....THEN when you use getSession().impersonate later...the variable that's there is just the sys_id...instead you're like running a function in a function...hence why there's probably issues.

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

10 REPLIES 10

Cody Smith _ Cl
Tera Guru

Hello John,

I found this answer a couple months ago to change the name. 

You can use the impersonation script to change the user who updated it.

var myUser = gs.getSession().impersonate("62826bf03710200044e0bfc8bcbe5df1");// sys_id of user who you want to be static or system.
// your business rule goes here
gs.getSession().impersonate(myUser);

 

If my answer was helpful, or solved your issue, please mark it as Helpful / Correct.
Thank you,
Cody Smith