inbound email action to update the incident assignment group based on the subject line

Mansi roy
Tera Contributor

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

14 REPLIES 14

Hi @Dr Atul G- LNG ,

 

Do i need to create new assignment rule based on the subject and assignment group?If this how to set in the script of inbound action so that it will automatically while incident will get create.

Hi @Mansi roy 

 

Yes, You need to create a new Assignment rule and in the condition you can add

short description contains == XYZ

 

and on based on this the incident get assigned. 

 

But if you are expecting that the short description should come from Inbound action ( as dynamic)  , which is not a possible case.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

hi @Dr Atul G- LNG .

I have created inbound action and assignment rule.I have like 25 short description.I have set the asisgnment group in assignment rule.

 

In inbound action what i need to write the code so that the incident will get auto assign to the assignment group based on the subject.

Hi @Mansi roy 

 

In the Assignment rule you need to mention the condition that 

A short description contains  and it works.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Anoja
Mega Sage

Hi @Mansi roy ,

 

Check the below script and modify it as per your requirement.

var subject = email.subject;
var gr = new GlideRecord('incident');
gr.initialize();
gr.caller_id = "sys id"; // 
gr.short_description = subject;
gr.impact = 2;
gr.urgency = 2;
if (subject.indexOf('test') != -1)
{
gr.assignment_group = "9ffed5264ff8ae02decaf0318110c998"; // Sysid of  Assignment Group
}
else
{
gr.assignment_group = "0e7fc75adbd92705b5ae71fa8c96188c"; // Sys id of your Assignment Group
}
gr.description = email.body_text;
gr.insert();