Inbound Email Actions "Create Incident" Assignment group not populating
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 01:46 AM
Hi Everyone
I have the following Inbound email Actions "Create Incident" action where i am trying to assign a ticket to whichever assignment group that gets pulled from the inbound email. The script i have changes the mandatory to grey and looks like its trying to reference the assignment group reference field, however its doesn't display the assignment group in the instance, can someone please advise on the corrected code ?
Thank you
Sue
My code is below:
// 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.short_description = email.subject;
//current.category = "inquiry";
current.incident_state = IncidentState.NEW;
//current.notify = 2;
//current.contact_type = "email";
if (email.body.assignment_group != undefined)
current.assignment_group = email.body.assignment_group;
if (email.body.description != undefined)
current.description = email.body_text;
if (email.body.contact_type != undefined)
current.contact_type = email.body.contact_type;
if (email.body.category != undefined)
current.category = email.body.category;
if (email.body.subcategory != undefined)
current.subcategory = email.body.subcategory;
if (email.body.priority != undefined) {
if (email.importance.toLowerCase() == "high") {
current.impact = 1;
current.urgency = 1;
}
}
if (current.canCreate())
current.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 02:01 AM
Hi @Kays,
Within the email, are you using the group's name for the assignment group attribute?
If so, can you try the following code instead?
current.assignment_group.setDisplayValue(email.body.assignment_group);
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 02:14 AM
Hi James,
Thank you for your quick response. Indeed this is pulling the name from the inbound email
I have changed the script accordingly, and while this is making the mandatory field asterix turn grey from red, it doesnt display the name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 02:19 AM
Can you confirm that there is a group in the Group table with the name used in the email?
Also, share the updated script as well
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 02:39 AM
Hi James,
I can confirm that there is a group in the group table with the same name as the inbound email that is pulling the name. The adjusted script is here
// 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.short_description = email.subject;
//current.category = "inquiry";
current.incident_state = IncidentState.NEW;
//current.notify = 2;
//current.contact_type = "email";
if (email.body.assignment_group != undefined)
current.assignment_group.setDisplayValue = email.body.assignment_group;
if (email.body.description != undefined)
current.description = email.body_text;
if (email.body.contact_type != undefined)
current.contact_type = email.body.contact_type;
if (email.body.category != undefined)
current.category = email.body.category;
if (email.body.subcategory != undefined)
current.subcategory = email.body.subcategory;
if (email.body.priority != undefined) {
if (email.importance.toLowerCase() == "high") {
current.impact = 1;
current.urgency = 1;
}
}
if (current.canCreate())
current.insert();