- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2015 05:36 AM
Hi,
We have a 3rd Party vendor who emails updates to our system, which include our INC number and a description in the Subject (and body) of what the Update should do, on hold, close etc.
As the email has no Watermark, is there a way of getting the Inbound Email action to check the Email, read the INC number and update the Incident by status.
Example email subject below and the emails will always come from the same address.
INC0010284 - Incident on Hold at 24/11/2014 20:02:30
I am relatively new to ServiceNow and have had a go, but sadly with no success. Any ideas would be great.
Thanks
Derek
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2015 06:17 AM
Yeah, it would be
var emailState = false;
if(email.subject.indexOf('On Hold') > -1)
emailState = true;
var incNum = email.subject.substring(0,10);
var inc = new GlideRecord('incident');
inc.addQuery('number', incNum);
inc.query();
if(inc.next()){
inc.comments = email.body;
if(emailState == true)
inc.incident_state = 'Pending';
inc.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2015 05:45 AM
Query the incident table for something like
var incNum = email.subject.substring(0,10);
var inc = new GlideRecord('incident');
inc.addQuery('number', incNum);
inc.query();
if(inc.next()){
inc.comments = email.body;
inc.update();
}
or whatever. Something like that.
Put it in an inbound email action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2015 06:09 AM
Thanks, Mike. That allows me update the Correct Incident with the email subject. Is there a way of look at the rest of the subject and when it sees On Hold, allow me set the Incident State to Pending.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2015 06:17 AM
Yeah, it would be
var emailState = false;
if(email.subject.indexOf('On Hold') > -1)
emailState = true;
var incNum = email.subject.substring(0,10);
var inc = new GlideRecord('incident');
inc.addQuery('number', incNum);
inc.query();
if(inc.next()){
inc.comments = email.body;
if(emailState == true)
inc.incident_state = 'Pending';
inc.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2015 06:18 AM
Your usage may vary depending on your field names. Pending probably has a number value. If it does, use that instead of 'Pending'.