Update existing incident based on email subject
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 11:29 PM
Hi,
Can we update the incident ticket based on the email subject if the existing ticket(short description) has the same subject(short description)?
for example, I sent an email to ServiceNow with the subject "ABC (User location) anything goes here" and then if I send email to ServiceNow with the same subject line again we need to update the existing ticket subject if the ticket is ACTIVE TRUE.
Can someone help me on this?
Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 02:05 AM
Hi,
check out the below links:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 02:01 AM - edited 12-05-2022 02:02 AM
Hi,
The following URL is having the OOB inbound action. If you enable it will work based on incident number.
YourInstanceName//sysevent_in_email_action.do?sys_id=3f789469c0a80064015ad36dc4205a9a&sysparm_record_target=sysevent_in_email_action&sysparm_record_row=2&sysparm_record_rows=5&sysparm_record_list=tableCONTAINSincident%5Etable%3Dincident%5EORDERBYorder
I would recommend dont go with incident short description to update the ticket. It's not best practise. If you want to update using short description use below script.
var updateINC = new GlideRecord('incident');
updateINC.addQuery('short_description', email.subject);
updateINC.addQuery('active','true');
updateINC.query();
if(updateINC.next()){
current.work_notes = email.body_text;
}
Suresh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2022 07:55 AM
Hi @ersureshbe ,
I have created new inbound action and I pasted your above script in Advanced section in Inbound action but its not updating the existing ticket, its creating ticket again. Am I missing anything?
Below are the screenshot of inbound action
Inbound action: 1
Thank you.