
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2022 10:07 PM
Hi Community,
I have requirement where I would like to update incidents via email by responding to email notification.
When I respond to email which has a ticket number in the subject system should take following action:
- Add email body to additional comments and copy all attachments from email to Incident
- Update status accordingly
- If incident is on hold -> move to in progress
- If incident is resolved -> reopen incident (move to in progress)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2022 02:02 AM
Hi Sanket,
There's a base line (Out Of Box) 'Inbound Action' that does pretty much what you require called: Update Incident (BP). (You can find this by typing 'Inbound Action' in the left navigation menu)
Check this Inbound Action is present and enabled (set to true). In order to update the state as you've requested, you'll need to include the below lines above the gr.update() call.
Best practice tip: Refrain from using a variable called 'gr' as per ServiceNow baseline code in this Inbound Action. This is often seen as used when calling GlideRecord which too should ideally be uniquely named. (rather than simply gr. Further info can be found here if you want to find out more: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0713029).
For consistency, and so as to mirror ServiceNow's own coding in this Inbound Action I've used 'gr' for this example.
To help others, please mark this as correct and/or helpful.
Thanks,
Robbie.
Script to add:
if (gr.state == 3) {
gr.state = 2;
}
} else if (gr.state == 6) {
gr.state = 2;
}
Screen shot of existing Inbound Action:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2022 02:02 AM
Hi Sanket,
There's a base line (Out Of Box) 'Inbound Action' that does pretty much what you require called: Update Incident (BP). (You can find this by typing 'Inbound Action' in the left navigation menu)
Check this Inbound Action is present and enabled (set to true). In order to update the state as you've requested, you'll need to include the below lines above the gr.update() call.
Best practice tip: Refrain from using a variable called 'gr' as per ServiceNow baseline code in this Inbound Action. This is often seen as used when calling GlideRecord which too should ideally be uniquely named. (rather than simply gr. Further info can be found here if you want to find out more: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0713029).
For consistency, and so as to mirror ServiceNow's own coding in this Inbound Action I've used 'gr' for this example.
To help others, please mark this as correct and/or helpful.
Thanks,
Robbie.
Script to add:
if (gr.state == 3) {
gr.state = 2;
}
} else if (gr.state == 6) {
gr.state = 2;
}
Screen shot of existing Inbound Action: