Inbound action call within inbound action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2016 12:24 PM
I was wondering if there was a possible way to script a call to an inbound action within the script of another inbound action or if there is a good way to have an inbound action reclassify an email's receive type and run the gambit of the inbound actions with the new reply type.
Here is my scenario:
Implementation partner built a custom table that gets "called" from an inbound action which acts similarly to inbound actions but separate. It governs field mapping when creating a new task of a specific type but is only called when an email receive type is "new". We have a need to essentially reclassify the receive type of an email from Reply to New when it identifies the email a reply to an inactive task so that it can be reprocessed as if it were a new email to create a new ticket.
Is there a good way to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2017 08:11 AM
This popped up again in my thread flow 😃
Do I get this right, a mail comes in, you want to do some stuff with it before the inbound actions take use of it.
Atm. I can see two pretty easy solutions beside the ones that have been mention.
1. Create a before BR on insert for the sys_email table. Then you can set you condition and do the stuff before it's save.
2. Create a inbound action with low order that does the stuff, stop processing and changes and reprocess the email (can take a look at the UI Action "reprocess email"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2017 04:55 AM
Thanks Goran, for your response. Created a inbound action with low order and tried to set receive type of the replied mail as "new" and trying to reprocess.
Inbound action is getting executed as per condition but No luck to achieve my requirement.
Manually I changed the type to "new" for the received reply, but on reprocessing again the state is geting changed back to 'Reply'. This value can not be overridden it seems.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2017 10:29 AM
So you are trying to take a reply and reprocess it as if it were a new email rather than a reply, is this correct?
If you elaborate I may be able to help some. Essentially what you'll want to do is put the same code for new emails in this, process it as new, then update the email record so that the type displays as new. Does this make sense?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2017 01:43 PM
FYI, do not use the method noted by jim.coyne. While it was a notable idea, in my testing it just ends up going in an endless loop as once you call the "email.read" event the event resets the state back to reply.
As mentioned I put a workaround in but I just have been made aware of a major issue with this. MY METHOD LOSES ALL ATTACHMENTS ON THE EMAIL!
I will work on how I can fix this to manually post these into the created record just please be aware of this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2017 02:47 PM
Okay I've got it working now. In order to get the attachments to copy over you need to add the following after the the task.insert() call:
var TktID = Intake.getUniqueValue();
var emailID = email.uid;
var em = new GlideRecord('sys_email');
em.addQuery('uid', emailID);
em.query();
if(em.next()){
//For debugging
}
var Emailsysid = em.sys_id.toString();
GlideSysAttachment.copy('sys_email', Emailsysid, 'ticket', TktID);