- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2019 09:52 AM
Hi ,
How can i populate Configuration item from email subject line to incident form (Configuration item field).
Subject line will be in the following format -
Device Name: XXXXXXX (CI Name) , Device IP Address: XXXXXXX , Severity: Critical.
From the above subject line It should Take Device name, on Incident form's CI field.
Any help would be appreciated.
Thanks in advance,
Meenal
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2019 10:26 AM
Hi there,
I did just a small test on my personal developer instance, with the subject you mentioned. See the results below. Obviously, you have to change it a little bit, I tested for example on a new email and an Insert of an Incident. Though, the principle is the same. The parsing you could also just copy.
(function() {
// The subject
var subjectStr = email.subject;
var ciStr = subjectStr.substring(subjectStr.lastIndexOf("Device Name: ") + 13, subjectStr.lastIndexOf(", Device IP Address: "));
var grIncident = new GlideRecord('incident');
grIncident.newRecord();
grIncident.setValue('short_description', ciStr);
grIncident.insert();
})();
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2019 03:42 AM
Hi mark,
The requirement is complete
Thanks and regards,
Meenal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2019 03:56 AM
Hi there,
Please mark this answer as correct as it solved your problem.
Thanks.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field