- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 03:23 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2017 08:04 PM
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.
Hope this helps. Mark the answer as correct/helpful based on impact.
Thanks
Antin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 03:27 AM
Hi Anshul,
Check the OOB Inbound action -- Create Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 03:36 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 12:26 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2017 06:17 PM
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();
}