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

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

Hi,

 

I tried but it didn't work.

Kindly advice

 

Regards,

Meenal

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

LinkedIn

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

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn