Inbound action to fetch Configuration item from email subject line to incident form.

Meenal Gharat
Giga Guru

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

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

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.

find_real_file.png

find_real_file.png

(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

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

6 REPLIES 6

Meenal Gharat
Giga Guru

Hi mark,

 

The requirement is complete

 

Thanks and regards,

Meenal

Hi there,

Please mark this answer as correct as it solved your problem.
Thanks.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn