inbound email action to update the incident assignment group based on the subject line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 02:00 AM
Hi All,
Can anyone please help me on the below requirement.
The incident should be created automatically when the email will come to the mail id..and based on the subject the assignment group should be set automatically.
Please let me know how to achieve this.
Regards,
Mansi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2024 04:04 AM
Hello @Anoja,
Thank you for the response. i need to auto assign the incident based on subject line.Suppose the email contains servicenow it will get auto assign to servicenow group.likethis i have more than 25 or 30 groups.How to achieve that one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 05:25 AM
Hi Mansi,
Could you please try this way
// Initialize the email subject
var subject = email.subject.toLowerCase(); // Create a GlideRecord object for the Subject Group Mapping table
var mapping = new GlideRecord('u_subject_group_mapping'); // Replace with your table name mapping.addQuery('u_keyword', 'LIKE', subject); // Ensure your keyword field is indexed for performance mapping.query(); // Initialize assignment group
var assignmentGroup = null; // Check if we have a matching record
if (mapping.next()) {
assignmentGroup = mapping.u_assignment_group; // Replace with your group field name
} // If a mapping was found, assign the incident to the group
if (assignmentGroup) {
var incident = new GlideRecord('incident');
if (incident.get(email.reference)) {
incident.assignment_group = assignmentGroup;
incident.update();
}
} else {
gs.info ('No assignment group found for the subject: ' + subject);
}
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 05:29 AM
Hi Mansi,
Could you please try this way
// Initialize the email subject
var subject = email.subject.toLowerCase(); // Create a GlideRecord object for the Subject Group Mapping table
var mapping = new GlideRecord('u_subject_group_mapping'); // Replace with your table name mapping.addQuery('u_keyword', 'LIKE', subject); // Ensure your keyword field is indexed for performance mapping.query(); // Initialize assignment group
var assignmentGroup = null; // Check if we have a matching record
if (mapping.next()) {
assignmentGroup = mapping.u_assignment_group; // Replace with your group field name
} // If a mapping was found, assign the incident to the group
if (assignmentGroup) {
var incident = new GlideRecord('incident');
if (incident.get(email.reference)) {
incident.assignment_group = assignmentGroup;
incident.update();
}
} else {
gs.info ('No assignment group found for the subject: ' + subject);
}
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 06:54 AM
Hello @Community Alums,
Shall i update on the email action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 04:32 AM
Hello @Community Alums , @Dr Atul G- LNG ,
I have created one table with name support group and i have created two columns one is assignment group and another one is subject.
I have updated the below code in inbound action. The incident is getting created.
But i am not getting why the assignment group is not taking from the table. Could please anyone help on this.
the below is the code for inbound action.