- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 01:59 AM
I want to Create Inbound action to create incident tickets from given white listed emails. Shall I create a group of white listed emails or a custom table?
I had a script for inbound action which check the member are in group and if yes then creates an incident.
Any solution would over this issue
Here it is
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 02:35 AM
You can create system property and store comma separated email in the property.
Check if Email is coming from Trusted emails, If yes then create incident and ass Caller as guest user.
If users are mapped with these emails id's then you can use group logic.
Try the suggested approach and Let us know if you are facing any issue.
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 02:08 AM
Hi,
Can you please share example of whitelisted email?
Is there any user available in SN with that email address?
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 02:12 AM
Hello Anil,
I have a 10 email IDs provided which are of same domain i.e: @gmail.com. Now I want to create incident on recieving an email from this email ID only.
I have created a user and assigned a email ID for test purpose

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 02:35 AM
You can create system property and store comma separated email in the property.
Check if Email is coming from Trusted emails, If yes then create incident and ass Caller as guest user.
If users are mapped with these emails id's then you can use group logic.
Try the suggested approach and Let us know if you are facing any issue.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 10:33 PM
@Anil Lande I have written this script for checking if the user is a member of whitelisted group. Please have a look. Can you suggest me if how can I test this functionality on my PDI as from vancouver we can send and recieve emails to PDI.
SCRIPT/---------------------------------------------------
(function runMailScript(/* GlideRecord / email, / TemplatePrinter */ template,
/* Optional EmailProcessor */ emailAction) {
// Get the sender's email address from the incoming email
var senderEmail = email.getValue('from');
// Check if the sender is a member of the custom group "whitelisted email"
if (isUserInWhitelistedGroup(senderEmail)) {
// Create a new incident record
var incident = new GlideRecord('incident');
incident.initialize(); // Set default values
// Set incident details based on your requirements
incident.short_description = 'Issue reported by whitelisted user';
incident.description = 'Details of the issue reported by ' + senderEmail;
// Insert the incident record
var incidentID = incident.insert();
// Log a message indicating that the incident was created
gs.info('Incident ' + incidentID + ' created for email from ' + senderEmail);
} else {
// Log a message indicating that the sender is not in the whitelisted group
gs.info('Email from ' + senderEmail + ' is not from a whitelisted group. No incident created.');
}
})(email, template, emailAction);
// Function to check if the sender is in the custom group "whitelisted email"
function isUserInWhitelistedGroup(senderEmail) {
// Specify the sys_id of the "whitelisted email" group
var whitelistedGroupSysID = 'your_whitelisted_group_sys_id';
// Check if the sender is a member of the specified group
var membership = new GlideRecord('sys_user_grmember');
membership.addQuery('user.email', senderEmail);
membership.addQuery('group', whitelistedGroupSysID);
membership.query();
return membership.hasNext();
}