Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Requirements

  • many-to-one assignment (one assignment group can have many email addresses)
  • should not have to edit code to add/update/delete queue mail aliases
  • should ignore Cc: address list

...

  • create/populate table 'u_group_mail_aliases':
    • u_email (string)
    • u_group (reference to sys_user_group)
  • update the Create Incident inbound action with something like this:

    Code Block
    // bw -- expose headers and text in description (just for PoC)
    // current.description = email.headers + email.body_text;
    
    // bw -- find assigment group by doing a lookup in u_group_mail_aliases
    // loop through email.direct 
    var addresses = email.direct.split(",");
    for (var i=0; i < addresses.length; i++) {
        var alias = new GlideRecord('u_group_mail_aliases');
        alias.addQuery('u_email', '=', addresses[i]);
        alias.query();
        if (alias.getRowCount() > 0) {
            break;
        }
    }
    // if there was an alias match, use it to assign group
    if (alias.getRowCount() > 0) {
    // first match wins!
        alias.next();
        current.assignment_group = alias.u_group;
    }
    


...

The mail alias binding to groups happens at the Group level in Adminstration Administration controls. Click a group, and then bottom of the dialogue page contains a tab called "Group Email Alias".

...

When YSS completes their work, and the alias is configured for the appropriate SN group, the email intake will auto-assign to the appropriate group.

Opinions on Service Now and inbound mail

Service Now isn't all that fantastic at handling mail, and incidents created from inbound mail are missing many properties that must be fixed before the recipient can handle the created incident. We also have spammable mail aliases, which then create bogus incident tickets we have to clean up. Eventually it would be nice to turn off inbound mail, or restrict it to a limited set of senders.

Debugging

We've had some issues which require us to correlate inbox contents with emails received by ServiceNow. Below is a utility script for diffing the two sets using message ID. Set the usernames, passwords accordingly.

...

Incident Draft