Inbound Email Action - Based on Recipient
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2018 03:48 PM
Hi All,
We have a mailbox setup that will automatically forward emails to our SN instance. Based on where the email is coming from, I'm trying to have incident tickets created with pre-populated fields. I'm having trouble with the script - as it's not recognizing the recipient and setting the INC fields accordingly.
Looking at the email log, I can see that 'feedback@mycompany.com' is showing in the "Recipients' field.
This is the snippet in question:
If (email.recipients.toLowerCase().indexOf('feedback@mycompany.com') > -1) {
current.assignment_group.setDisplayValue("Group 1");
}
else {
current.assignment_group.setDisplayValue("Group 2");
}
TIA!
Keith

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2018 04:07 PM
try
if (email.from.toLowerCase().indexOf('feedback@mycompany.com') != -1) {
current.assignment_group.setDisplayValue("Group 1");
}
else {
current.assignment_group.setDisplayValue("Group 2");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2018 06:15 AM
Thanks Mike; doesn't want to work - I also couldn't find any documentation for 'email.from'.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2018 06:24 AM
try below. I have inbound action that uses email.from and works fine for me.
if (email.from.toLowerCase().indexOf('feedback@mycompany.com') > -1) {
current.assignment_group.setDisplayValue("Group 1");
}
else {
current.assignment_group.setDisplayValue("Group 2");
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2018 06:26 AM
also try setting group using sysid something like
current.assignment_group = 'sysid';