- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2022 08:18 AM
Hello,
I want to set an inbound email action to look at the email body and update this into fields on the form.
This is where I'm up to so far... But I dont know how to look and update the specific fields with the data.
current.caller_id = gs.getUserID();
current.description = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
current.incident_state = IncidentState.NEW;
current.notify = 2;
current.contact_type = "monitoring";
current.insert();
What I'm looking for is to populate this email into the relevant fields,
KBA: https://instance.service-now.com/ work_notes (link to kba)
CATEGORY: category
SUB_CATEGORY: subcategory
IMPACTED_SERVICE: impacted_service
CONFIG_ITEM: cmdb_ci
SHORT_DESC: short_description
PRIORITY: P2 = priority
ASSIGNMENT_GROUP: assignment_group
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2022 09:12 AM
Hi, I sorted it using line...
if (email.body.config_item != undefined) {
current.cmdb_ci.setDisplayValue(email.body.config_item);}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2022 08:45 AM
Hey,
Since you have the email in required format, you can try directly something like this:
"email.body.tagName"
eg: email.body.kba
email.body.category
Try with these and add some gs.info logs to verify(If small doesn't work, try all caps i.e. KBA, CATEGORY)
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2022 09:08 AM
Hi,
I've tried using this statement but still no joy.
if (email.body.config_item_ != undefined) {
current.cmdb_ci.setDisplayValue(email.body.config_item);}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2022 09:12 AM
Hi, I sorted it using line...
if (email.body.config_item != undefined) {
current.cmdb_ci.setDisplayValue(email.body.config_item);}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2022 09:13 AM
Yes, this should work.
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar