- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2019 07:41 AM
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.
Solved! Go to Solution.
- Labels:
-
Service Desk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 08:13 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 07:55 AM
Thank you, we're getting closer. The code now looks like this:
if ((email.subject.toLowerCase().indexOf("please reopen") >= 0 || current.state == "6") && current.state != "7") {
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
current.update();
current.state = "2";
gs.getSession().impersonate(myUser);
current.work_notes = "The caller did not feel that this issue was resolved";
current.update();
The result now is that the comment in the ticket AND email shows the impersonator's name, but the work note shows the user's name. Ideally, I don't want to use impersonation on the comment -- that should actually reflect the user's name since they did enter that comment. So however the code is impersonating the comment is how I'd like to impersonate the work note (and not do anything to the comment).
Thanks for your help -- really appreciate the feedback!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 08:08 AM
As odd as this may sound....try moving the work-note up to the comment spot and the comment spot to the work-note spot?
Haha...doesn't seem like it should work that way, but try that?
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 08:13 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 08:53 AM
Thank you Allen, that last little tidbit solved the problem. So the final working code looks like this:
var myUser = "e8c785ac4f649e002de27bcd0210c75d";
if ((email.subject.toLowerCase().indexOf("please reopen") >= 0 || current.state == "6") && current.state != "7") {
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
current.update();
current.state = "2";
gs.getSession().impersonate(myUser);
current.work_notes = "The caller did not feel that this issue was resolved";
current.update();
Everything is working correctly now. Thank you so much for your diligence and willingness to help!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 03:05 AM
Hello,
I am experiencing the same issue while update the 'work notes' from 'Update Record' Action in Flow Designer.
Could you please help me how to fix this one ?