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:40 AM
You didn't update it correctly, it should be the following
current.assignment_group.setDisplayValue(email.body.assignment_group);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 02:46 AM
Hey James,
Update that, but still no joy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 02:50 AM - edited 02-27-2024 02:50 AM
Can you try this
current.setDisplayValue('assignment_group', email.body.assignment_group);
Also try debugging by adding some log, e.g.
gs.info('Inbound email log; Body group name is : ' + email.body.assignment_group);
Maybe the value of the group isn't being extracted correctly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 03:04 AM
Thanks James, i did think that and did catch a space on the group being sent and thought that may be an issue. I will also try with one that does have this syntax abc - efg
Will add the log now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 04:07 AM
James,
Nothing showing in the log. The only error i see is the following: The selected 'Recipients in fields' - 'assigned_to' does not have value