Changing the SNOW Email notification "From" or Reply TO depending on Departments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 07:43 AM
I have a need, depending on WHO is working a ticket, to change the From and Reply To USER to the appropriate email.
Use Case:
If the Finance group is working the ticket, then the From / Replay should show "Finance Department <finance@company.com>".
Or our Security Group, then "Security <security@company.com>", etc...
I've attempted to use the OOB From and Reply To fields, as well as, adding a mail script:
if(current.assignment_group =="guid_id"{
email.sentFrom("My Group <group_queue@company.com>");
}
else if(current.assignment_group =="guid_id2"{
email.sentFrom("My Group <group_queue2@company.com>");
}
etc....
Either way i sent this, the system show the Notification in the SENT mailbox, however, I never receive the email. If i remove this, then it sends.
Should I contact HI or is there a property/BR/SOMETHING that is not allowing the email to go out.
THanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 07:48 AM
@EricG Update your code as follows.
if(current.assignment_group =="guid_id"{
email.setFrom("My Group <group_queue@company.com>");
}
else if(current.assignment_group =="guid_id2"{
email.setFrom("My Group <group_queue2@company.com>");
}
There is no method with name sentFrom exist on the email object hence the script is crashing. Instead the method name is
setFrom(String address):
override the sender address.
For more information please refer to https://docs.servicenow.com/bundle/tokyo-servicenow-platform/page/script/server-scripting/reference/...
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 08:25 AM
OOPS. 😁 LOL. It's hard being dyslexic too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 08:32 AM
Sandeep Rajput Ok - the email is going out (being sent to my TEST mailbox) however it's still showing IT Help Desk
It should have been option 1 group_queue@company.
Do i need to remove the Email Account system property?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 09:38 AM
@EricG Could please check if the from field is populated on the notification if yes then please remove it and only set it via the mail script.