Inbound Action: assign group by email, only works with some emails?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2024 05:49 AM
My org has been slowly asking me to add script to our Create Incident (New) and Create Incident (Forward) inbound email actions that will recognize messages from certain email addresses and auto-assign them to a corresponding group. This worked great for the first two email address/assignment group combinations.
Then, I was asked to add two more email address/assignment group relationships. In trying to test them, however, I seem to be finding that the script itself is fine, but that the new email address and my testing email address will not be recognized and assigned to their corresponding groups? It seems to be distinctly the specific email addresses, I can swap them around in the script and the two that work (let's call them ddl@org and vmasc@org) will work for assigning any group they're scripted to. Using test emails of me@icloud and me@gmail also work for any group in any order of the script.
Conversely, wsp@org, the email address I'm trying to script for, just won't work. It creates incidents, but it won't assign them to a group, no matter which group name I script or what order I place it in the script. The same goes for me@org.
So far, I can't explain this. The fact that some @OrG emails will work and some will not makes me very uneasy about how I can reliably test this and deploy to production. What am I doing wrong?
Script:
if (email.from.indexOf('me@odu.edu') >= 0){
current.assignment_group.setDisplayValue('DL Web Innovation');
current.state = 2;
}
if (email.from.indexOf('me@gmail.com') >= 0){
current.assignment_group.setDisplayValue('EVMC DSG');
current.state = 2;
}
if (email.from.indexOf('wsp@odu.edu') >= 0){
current.assignment_group.setDisplayValue('Web Content Support');
current.state = 2;
}