- 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-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-17-2019 04:33 AM
Hi,
I tried but it didn't work.
Kindly advice
Regards,
Meenal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 07:50 AM
What did you exactly try? Can you share screenshots? I tried, see the screenshots, works like a charm.
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:35 AM
Hi there,
Did this solve your question? Or do we need to follow up on this?
Please mark this answer as correct if it solves your problem. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
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