- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2022 06:59 AM
For example:-
if sender is abel tuter@service now.com, create two incident tickets with contents of the email and assign to two different assignment groups.
create incident ticket to
1. Technical group with short description as "software issue" and
2. create another incident ticket for cmdb group with short description as "windows server".
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2022 12:11 PM
You can also try this code to achieve your requirement, It's easy to understand the logic and Tested by me:-
create Inbound Email Action
In Action tab copy and paste below code and change sys id as per your business requirement.
(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
var group = ["019ad92ec7230010393d265c95c260dd","0a52d3dcd7011200f2d224837e6103f2"]; // Instead of passing sys_id in code try to create system properties and call it in array name is group its good pratice and recommended by servicenow.
var short_description = ["software issue","windows server"];
var j = 0;
for(var i = 0 ; i<= group.length-1;i++){
var gr = new GlideRecord("incident");
gr.intialize();
gr.assignment_group = group[i];
gr.short_description = short_description[j];
gr.description = email.body_text;
gr.insert();
j=j+1;
}
})(current, event, email, logger, classifier);
Regards,
Imran Ahmad
Please send your feedback
Please Mark helpful below:-

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2022 11:52 AM
Hii Mandhula,
Try this code its very simple and 100% working and tested by me:-
Create Inbound Email Action.
In Action tab paste this code and change the sys_id to your required group.
(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
var group = ["019ad92ec7230010393d265c95c260dd","0a52d3dcd7011200f2d224837e6103f2"]; // Instead of passing sys_id in code try to create system properties and call it in array name is group its good pratice and recommended by servicenow.
var short_description = ["software issue","windows server"];
var j = 0;
for(var i = 0 ; i<= group.length-1;i++){
var gr = new GlideRecord("incident");
gr.intialize();
gr.assignment_group = group[i];
gr.short_description = short_description[j];
gr.description = email.body_text;
gr.insert();
j=j+1;
}
})(current, event, email, logger, classifier);
If you are testing from PDI then copy your instance number like: dev98098@servicenowdevelopers.com
But the email Id your are using for testing that email ID should be email of Abel Tuter edit it from sys_user tale.
Regards,
Imran Ahmad
Please Mark Helpful below:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2022 12:11 PM
You can also try this code to achieve your requirement, It's easy to understand the logic and Tested by me:-
create Inbound Email Action
In Action tab copy and paste below code and change sys id as per your business requirement.
(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
var group = ["019ad92ec7230010393d265c95c260dd","0a52d3dcd7011200f2d224837e6103f2"]; // Instead of passing sys_id in code try to create system properties and call it in array name is group its good pratice and recommended by servicenow.
var short_description = ["software issue","windows server"];
var j = 0;
for(var i = 0 ; i<= group.length-1;i++){
var gr = new GlideRecord("incident");
gr.intialize();
gr.assignment_group = group[i];
gr.short_description = short_description[j];
gr.description = email.body_text;
gr.insert();
j=j+1;
}
})(current, event, email, logger, classifier);
Regards,
Imran Ahmad
Please send your feedback
Please Mark helpful below:-