- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2019 07:47 PM
Emails that are recalled should not create a new service request.
In this circumstance ServiceNow should match the message id to the original email sent and include the recall message in the original service request created.
Ideally, the original service request should automatically be resolved/closed. If this is not possible then the existing system notification to the assignee must be triggered to allow them to manually close the request.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2019 10:09 PM
Hi Anvesh,
i tried to recall an email from outlook which was previously sent to my PDI(personal developer instance). In the received email at the instance, I found the keyword "Recall" appended or prefixed in my email's subject. I used that and tried to delete the incident created by the accidentally sent mail by matching the subject line. I was successful in this. Therefore if you can fetch the incident created(in my case to delete it) you can update it with whatever value you want using the "email.subject" / "email.body" along with updating the state value of the record. Please find the screenshots and code below:
Action Script
(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
// get Subject and remove recall by splitting it by ":"
//as the subject in call mail was "Recall: test mail"
//and the accidental email's subject was "test mail"
var sub = email.subject.split(':');
//trim any spaces
var subject = sub[1].trim();
//gliderecord to find a matching incident with the subject
var gr = new GlideRecord('incident');
gr.addQuery('short_description',subject);
gr.query();
if(gr.next()){
gr.deleteRecord();
}
})(current, event, email, logger, classifier);
Regards
Air
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2019 10:09 PM
Hi Anvesh,
i tried to recall an email from outlook which was previously sent to my PDI(personal developer instance). In the received email at the instance, I found the keyword "Recall" appended or prefixed in my email's subject. I used that and tried to delete the incident created by the accidentally sent mail by matching the subject line. I was successful in this. Therefore if you can fetch the incident created(in my case to delete it) you can update it with whatever value you want using the "email.subject" / "email.body" along with updating the state value of the record. Please find the screenshots and code below:
Action Script
(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
// get Subject and remove recall by splitting it by ":"
//as the subject in call mail was "Recall: test mail"
//and the accidental email's subject was "test mail"
var sub = email.subject.split(':');
//trim any spaces
var subject = sub[1].trim();
//gliderecord to find a matching incident with the subject
var gr = new GlideRecord('incident');
gr.addQuery('short_description',subject);
gr.query();
if(gr.next()){
gr.deleteRecord();
}
})(current, event, email, logger, classifier);
Regards
Air
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2019 10:52 PM
Thanks Air, this is the solution i was looking for.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2019 11:03 PM
Hi Anvesh,
I am glad that it helped!!
Regards
Air
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2020 12:24 AM
Hi Air,
My condition is somewhat different here. I want to update my request if user has recalled and replaced the content of outlook mail.
Pls help.
Regards,
Nikita