How to close/resolve an incident using an inbound email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Team,
Has anybody achieved closing/resolving an incident from inbound email which is separate and dont have a common link to the 1st email.
The system generate an initial email for an alert then generate anohter separate email for alert clearance. There is no event ID and would like to use maybe the subject to search the incident created so that the 2nd email can resolve it.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
lets consider keyword is in subject :
Parse subject for unique identifier
var subject = email.subject;
var identifier = subject.substring(subject.indexOf("identifier:"), subject.length);Now query the incident table with the identifier:
// Query incident table
var gr = new GlideRecord('incident');
gr.addQuery('short_description', 'CONTAINS', identifier); // or use custom field
gr.addQuery('active', true);
gr.query();
if (gr.next()) {
gr.state = 6; // Resolved
gr.close_code = 'Solved ';
gr.close_notes = 'Auto-resolved from email';
gr.update();
}
Refer:
Update incident without watermark: https://www.servicenow.com/community/servicenow-ai-platform-forum/update-incident-from-email-with-no...
