Assigning the tickets to groups from alerts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 08:44 PM
Hello All,
I have a question regarding assigning the tickets based on the code in Subject line of the assignment group.
Situation: We have alerts coming from our firewall support team.
These are alert emails.In the subject line of the email we have the location names mentioned.
I want to extract these location codes and asign the tickets to the local Servicedesk.
Eg: if ticket is from india then assign it to it_servicedesk india
if it is china the IT_Servicedesk_China etc.
Now i have written an inbound email which creates a ticket but does not assign the ticket to the groups.
Help would be appreciated.
Thanks in advance,
Renu.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 08:47 PM
Hi @Renu4 ,
Can you share your code which you have tried?
Also an example of how the subject line looks?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 09:50 PM
Hi Ani07,
the subject line image is attached below.
Inbound actions are here:
(function runAction( /*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
current.caller_id = gs.getUserID();
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
current.state = IncidentState.NEW;
current.urgency = 1;
current.impact = 1;
current.contact_type = "monitoring";
if (email.body.assign != undefined)
current.assigned_to = email.body.assign;
if (email.importance != undefined) {
if (email.importance.toLowerCase() == "high")
current.priority = 1;
}
if (email.body.priority != undefined)
current.priority = email.body.priority;
current.insert();
//
})(current, event, email, logger, classifier);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 10:01 PM
Hi @Renu4 ,
No were here you have used my logic ?
try this but you need to adjust the code to make it work on your instance,
(function runAction( /*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
current.caller_id = gs.getUserID();
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
current.state = IncidentState.NEW;
current.urgency = 1;
current.impact = 1;
current.contact_type = "monitoring";
if (email.body.assign != undefined)
current.assigned_to = email.body.assign;
if (email.importance != undefined) {
if (email.importance.toLowerCase() == "high")
current.priority = 1;
}
if (email.body.priority != undefined)
current.priority = email.body.priority;
////////////// here is my logic ///////////////////////
if((email.subject.indexOf('china') <= -1){
current.assignment_group = 'sys_id' // use sys_id of the group or call sys_properties
} else if ((email.subject.indexOf('india') <= -1){
current.assignment_group = 'sys_id' // use sys_id of the group or call sys_properties
} ((email.subject.indexOf('brazil') <= -1){
current.assignment_group = 'sys_id' // use sys_id of the group or call sys_properties
}
////////////// here is my logic ///////////////////////
current.insert();
})(current, event, email, logger, classifier);
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 09:41 PM
Hi Sohail,
i used the same logic but now the issue is if i give any location the mail is being triggered only to india sevicedesk.
i mean to say its not checking for the else if part of the code.