Inbound Action - Prevent the creation of multiple tickets from alerts with the same subject
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
We are receiving multiple alerts with the same subject within a single day. We would like to prevent the creation of duplicate tickets when multiple alerts have the same subject.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Can you give more details . Sample Events and also is this ITOM related events ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @MarkJustinC6114
I would encourage you to submit this as an idea to ServiceNow so that they include such logic in their Out-of-the-box (oob) "Create Incident" Inbound e-mail action.
Usually when multiple alerts are received then they do have different timestamp however it is the subject according to you which defines duplicate, then it will be easy for you to stop processing your email inbound action further.
For example: Below is the oob inbound action whose code can be updated in the beginning to first gliderecord the incident table to query short_description (if it is your subject) with alert subject including Active Query:
var existingInc = new GlideRecord('incident');
existingInc.addQuery('short_description', email.subject);
existingInc.addActiveQuery();
existingInc.orderByDesc('sys_created_on');
existingInc.setLimit(1);
existingInc.query();
if (existingInc.next()) {
existingInc.comments ="Duplicate email received from: " + email.origemail +"\n\n" + email.body_text;
existingInc.update();
} else { //remaining code of existing oob Create Incident Inbound action
Hope that helps!
