- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2022 05:37 AM
Hello all,
It has been requested that when an ITIL user replies to an Incident via email, that the email message go into Work Notes, while if the caller replies, it goes into Additional Comments.
I believe the Update Incident (BP) should be cloned and modified after, but am not quite sure how to achieve this.
Can anyone share some insight on the script?
Thanks in advance,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2022 05:43 AM
Thanks for the response Allen, especially with regard to changing OOB items instead of cloning. This just came up as an issue in our Service Portal as well after upgrading to Rome, and as soon as I realized what was wrong I thought of your reply.
I ended up adding this to the Inbound Action for Update Incident (BP) and it is working the way I had hoped (ITIL emails get added as Work Notes, user emails get added as Comments):
if (gs.hasRole("itil")) {
gr.work_notes = "reply from: " + email.origemail + "\n\n" + email.body_text;
} else {
gr.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2022 07:30 AM
Hi,
In 2020, ServiceNow changed their perspective that you should instead update the out of box scripts in various scenarios. This allows it to be rightfully reviewed/addressed upon upgrade.
With that said, you'd have to take the current user, query the sys_user_has_role table and see if they have the ITIL role, then if so, map their email body to the worknotes, else go to comments.
GlideRecord: https://developer.servicenow.com/dev.do#!/reference/api/paris/server/no-namespace/c_GlideRecordScope...
Please mark reply as Helpful/Correct, if applicable. Thanks!
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-29-2022 05:43 AM
Thanks for the response Allen, especially with regard to changing OOB items instead of cloning. This just came up as an issue in our Service Portal as well after upgrading to Rome, and as soon as I realized what was wrong I thought of your reply.
I ended up adding this to the Inbound Action for Update Incident (BP) and it is working the way I had hoped (ITIL emails get added as Work Notes, user emails get added as Comments):
if (gs.hasRole("itil")) {
gr.work_notes = "reply from: " + email.origemail + "\n\n" + email.body_text;
} else {
gr.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
}