Inbound email action - auto populate values in incident table from email body
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 03:02 AM
Hi,
How to populate fields value in incident table from email body using inbound action. once i send email with few parameters, automatically those parameter fields values should be mapped to that particular field in incident table.
example: suppose from email you send any parameter such as name of the
configuration item : Ansible
category: Software
assignment group: test group.
description : ansible incident test.
Thanks in advance,
Nivethika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 03:15 AM
Hi,
you can get value of those like this
there is particular syntax to get the value from name: value pair
var description = email.body.description.trim();
var group = email.body.assignment_group.trim();
var category = email.body.category.trim();
var ci = email.body.configuration_item.trim();
current.category = category;
current.description = description;
current.setDisplayValue('cmdb_ci', ci);
current.setDisplayValue('assignment_group', group);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 03:29 AM
Thank you Ankur.
I tried using the above method, let me attach here. please correct me if i am wrong.
inbound email action - when to run type: new and script below
from mail i have sent like this
It didnt map in incident table.
Please help me out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 03:37 AM
Hi,
did you check in logs what came for those 4 values?
Are you sure your inbound action ran?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 03:43 AM