- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 11:34 AM
Hi All ,
I am trying to create incident through inbound email action , If user is not present it has to populate guest user which is hard coding in script. but it is not working. Please see script below. let me know what is the issue here
var callerID = gs.createUser(email.from);
//var callerID = queryTable("sys_user","email",email.user);
if(callerID != ''){
current.caller_id = callerID;
}
else {
current.caller_id = '327f735adb7d17403ffa36be3b96194a';
}
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 12:29 PM
Try the below code.
var newUser = new GlideRecord('sys_user');
newUser.addQuery('email', email.from);
newUser.query();
if(newUser.next()) {
current.caller_id = gs.getUserID();
} else {
current.caller_id='327f735adb7d17403ffa36be3b96194a'; //ensure the sys_id of user is correct here.
}
current.insert();
Mark the comment as a correct answer and also helpful once worked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 12:29 PM
Try the below code.
var newUser = new GlideRecord('sys_user');
newUser.addQuery('email', email.from);
newUser.query();
if(newUser.next()) {
current.caller_id = gs.getUserID();
} else {
current.caller_id='327f735adb7d17403ffa36be3b96194a'; //ensure the sys_id of user is correct here.
}
current.insert();
Mark the comment as a correct answer and also helpful once worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 12:42 PM
thank you so much, it's working as expected.