Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2025 03:15 AM - edited 06-11-2025 03:16 AM
// Get the email subject and body
var subject = email.subject;
var body = email.body_text;
// Look for a ticket number in the subject (e.g., INC0000001)
var regex = /INC\d{7}/;
var match = regex.exec(subject);
if (match) {
// A ticket number was found
var ticketNumber = match[0];
var incidentGR = new GlideRecord('incident');
incidentGR.addQuery('number', ticketNumber);
incidentGR.addQuery('state','7'); // please add state of closed
incidentGR.query();
if (incidentGR.next()) {
// Incident found, update its comments
incidentGR.count = incidentGR.getValue('count')+1;
incidentGR.update();
}
}
Use the above code inbound action.
create a new field in the table update the same in the code, and update table names as well.