Set Incident Urgency based off Caller Group (Emailed Incidents)

nickm5816667392
Tera Contributor

We currently allow users to open incidents by emailing our instance. These incidents are low impact/urgency/priority by default. 

 

We're looking to automatically set the Urgency to High in the event one of our VIP users sends this email. These VIP users exist in an AD security group that syncs with ServiceNow.

 

We're running Yokohama. Hoping there is something OOB we can rely on. Thanks in advance!

1 ACCEPTED SOLUTION

@nickm5816667392 

you can check if the user who is responding is member of that group

something like this but please enhance

//  Note: current.opened_by is already set to the first UserID that matches the From: email address

current.caller_id = gs.getUserID();
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.description = email.body_text;
current.short_description = email.subject;


if(gs.getUser().isMemberOf('Group ABC')){
    current.priority = 2; // high
}

current.category = "inquiry";
current.incident_state = IncidentState.NEW;
current.notify = 2;
current.contact_type = "email";
//current.assignment_group = 'ff796f1847314a1006ec046fe16d4379';
/*
if (email.body.assign != undefined)
   current.assigned_to = email.body.assign;

if (email.importance != undefined) {
   if (email.importance.toLowerCase() == "high") {
        current.impact = 1;
        current.urgency = 1;
   }
}

if (current.canCreate())*/
current.insert();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

15 REPLIES 15

James Chun
Kilo Patron

Hi @nickm5816667392,

 

I am not sure if there is an OOB functionality, but here are some options:

 

  • Set the VIP field of the User records to True for those in the VIP group.
    • Either create some flow/business rule/scheduled job or check with your AD admin if they have a property that can be synced back to ServiceNow.
  • Do you want to escalate the impact/urgency only when it's created through an email?

Hope that helps, cheers

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@nickm5816667392 

approach

1) you can use the inbound email action script to see which user replied and check in sys_user if that's VIP user (either VIP flag is true or that user is member of particular group) and then se the Impact, Urgency and Priority

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar , I don't have a ton of experience with inbound email action scripts yet, however, I think I found a spot where this could be done.

 

I've located under Inbound Email Actions, a rule called Create Incident. Below is what this rule does. I'm thinking this is a good spot to add some code to check the group and set the priority? I'll also include a screenshot.

 

Any changes I make, I'll obviously test in Dev first.

 

Thanks!

//  Note: current.opened_by is already set to the first UserID that matches the From: email address

current.caller_id = gs.getUserID();
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.description = email.body_text;
current.short_description = email.subject;

current.category = "inquiry";
current.incident_state = IncidentState.NEW;
current.notify = 2;
current.contact_type = "email";
//current.assignment_group = 'ff796f1847314a1006ec046fe16d4379';
/*
if (email.body.assign != undefined)
   current.assigned_to = email.body.assign;

if (email.importance != undefined) {
   if (email.importance.toLowerCase() == "high") {
        current.impact = 1;
        current.urgency = 1;
   }
}

if (current.canCreate())*/
    current.insert();

@nickm5816667392 

you can check if the user who is responding is member of that group

something like this but please enhance

//  Note: current.opened_by is already set to the first UserID that matches the From: email address

current.caller_id = gs.getUserID();
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.description = email.body_text;
current.short_description = email.subject;


if(gs.getUser().isMemberOf('Group ABC')){
    current.priority = 2; // high
}

current.category = "inquiry";
current.incident_state = IncidentState.NEW;
current.notify = 2;
current.contact_type = "email";
//current.assignment_group = 'ff796f1847314a1006ec046fe16d4379';
/*
if (email.body.assign != undefined)
   current.assigned_to = email.body.assign;

if (email.importance != undefined) {
   if (email.importance.toLowerCase() == "high") {
        current.impact = 1;
        current.urgency = 1;
   }
}

if (current.canCreate())*/
current.insert();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader