Where is the Guest user define in system?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2019 04:25 AM
When email is sent , HR case is getting created in my instance.
But when email is sent via personal email id(gmail.com) then also Hr case is getting created as Opened By value set to "Guest".
I would like to know that where this script is define in system that Opened By field will be "Guest" when user is not present in SNOW(email id not in system/personal email id)?
I checked the inbound email action using which Hr case is getting created but there is no such script define there.
Below is the script from inbound email action.
if (email.importance !== undefined) {
if (email.importance.toLowerCase() == "high")
current.priority = 1;
} else
current.priority = 3;
var bodyText = email.body_text;
if (!bodyText)
bodyText = email.body_html;
current.work_notes = "HR Case created by email:\n\nReceived from: " + email.origemail + "\n\n" + email.subject + "\n\n" + bodyText;
current.description = bodyText;
//Re-direct who gets the case based on recipient:
if(email.recipients.toLowerCase().indexOf(gs.getProperty("sn_hr_core.hr_email").toLowerCase()) > -1){
current.assignment_group="d8620530db2a43000a4c3c8f9d9619c3";
}
else{
current.assignment_group="723aa84f5ba02200502f6ede91f91aea";
}
// Core email rules assign "Guest" if the from email does not match a user.
// In this case, check the HR profile personal email, and reassing the case to that user.
var profile;
if (gs.getUserID() != '5136503cc611227c0183e96598c4f706') { //GUEST SYS_ID
// Find and attach profile if it exists
current.caller_id = gs.getUserID();
current.opened_by = gs.getUserID();
current.opened_for = gs.getUserID();
profile = new GlideRecord('sn_hr_core_profile');
profile.addQuery('user', gs.getUserID());
profile.query();
if (profile.next())
current.hr_profile = profile.sys_id;
}
current.subject_person = current.opened_for;
var newId = current.sys_id;
gs.eventQueue('sn_hr_core_case.email.creation', current, newId, email.from);
- Labels:
-
HR Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2019 04:40 AM
If you need to auto create a new user then check this link https://docs.servicenow.com/bundle/london-servicenow-platform/page/administer/notification/task/t_EnablingAutomaticUserCreation.html#t_EnablingAutomaticUserCreation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2019 04:41 AM
I agree but where the script is define to take untrusted user as a Guest?
I am not able to find that script in my system
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2019 04:58 AM
Just curious, what are you looking to on the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2019 05:02 AM
As per Service Now, This logic is controlled by Email Automatic User Creation plugin. This is built-in function and we can not modify it.
What is that you are trying to achieve here, Can you explain?