how to restrict incident creation from calendar invites for DL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2025 05:43 AM
As of now we are creating an Incidents via Inbound action , but when there is a calendar invite , still it is creating Incident , How to restrict that ?
I am not able to restrict subject , as it can be any
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
emailContent += '<table role="presentation" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse;"><tr><td style="height:8px; line-height:8px; font-size:1px;"> </td></tr></table>';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
var username = '';
if (elid) {
var userGR = new GlideRecord('sys_user');
userGR.addQuery('u_elid', 'IN', elid); // <-- IN instead of default =
userGR.query();
var names = [];
while (userGR.next()) { // <-- loop instead of single next()
names.push(userGR.name.toString());
}
if (names.length > 0) {
username = names.join(' and '); // or ', ' depending on desired formatting
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @RudhraKAM ,
Since the subject of a calendar invite can be anything, restricting Incident creation based on the email subject would not be a reliable solution.
A better approach would be to identify whether the incoming email is a calendar/meeting invite and skip the Incident creation logic in the Inbound Email Action.
You can check for indicators such as:
.ics attachments
BEGIN:VCALENDAR content in the email body
METHOD:REQUEST, METHOD:CANCEL, etc.
Calendar-related MIME types (text/calendar)
By adding a validation at the beginning of the Inbound Action script, you can prevent Incident creation whenever the incoming email is recognized as a calendar invite.
For example:
if (email.body_text.indexOf('BEGIN:VCALENDAR') > -1 ||
email.body_text.indexOf('METHOD:REQUEST') > -1) {
return; // Skip Incident creation
}
Alternatively, you can check for .ics attachments or calendar-related content types in the email headers.
This approach is more effective because it identifies the actual nature of the email rather than relying on the subject line, which can vary from one meeting invite to another.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
gs.info('DEBUG TCM - elid raw: [' + elid + '] length: ' + elid.length);
gs.info('DEBUG TCM - encoded query: ' + userGR.getEncodedQuery());
gs.info('DEBUG TCM - can read user_name: ' + gs.hasRole('admin'));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
https://<your-instance>.service-now.com/sys_user_list.do?sysparm_query=active=true^u_elid=hickssl^ORuser_name=hickssl