OOTB guest functionality in service now

anshul_jain25
Kilo Guru

Hi All,

There is a OOTB functionality in service now that when a user who is not present in service now and sends a mail to service now than a incident ticket is created for that user as a guest.

Where is code for this functionality present, i want to modify this and use my own created new user for HR cases only.....so when any email is coming for new user a ticket should gets created for my new user not for guest.

1 ACCEPTED SOLUTION

antin_s
ServiceNow Employee
ServiceNow Employee

Hi Anshul,



You need to make the change in "Create HR Case" Inbound Email action. Please change the highlighted lines in the below snapshot to point to the user record you want.



find_real_file.png




Hope this helps. Mark the answer as correct/helpful based on impact.



Thanks


Antin


View solution in original post

6 REPLIES 6

snehabinani26
Tera Guru

Hi Anshul,



Check the OOB Inbound action -- Create Incident


rajmasurkar
Giga Guru

Hi Anshul,



The functionality is like if you have an active user account 'guest' in your instance, then for any email coming in from an email id which is not available in the instance;


the incident will be created with Created by as 'Guest'




Raj


yes this i know.


but what i want to do is for HR module i have a inbound emails action and what i want is when any guest email is coming and metting my inbound email condition than a hr case should get raised for guest if that user when sent mail is not present in service now.


how can i achieve this.


tim210
ServiceNow Employee
ServiceNow Employee

Hi Anshul,



I understand you want an Inbound Action that creates HR incident records only when the From email address on the incoming email doesn't match an existing ServiceNow user? If so the code below should do this. To use it put it in an Inbound Action against the HR incident table that triggers off new emails. Also make sure that System Property glide.pop3readerjob.create_caller is set to false.



Let me know how you go.


usersearch = new GlideRecord('sys_user');


usersearch.addQuery('email', email.origemail);


usersearch.query();


if (usersearch.hasNext())


{


      gs.log("Existing user with email address " + email.origemail + " found, not creating HR incident");


}


else


{


      gs.log("No existing user with email address " + email.origemail + " found, creating HR incident");


      current.insert();


}