
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2019 10:51 PM
I have an Inbound email action I’ve created to create Requested items when an email is sent to a particular mailbox e.g abc123@cba321.com
Target table: sc_req_item
Action Type: Record Action
Active: yes
Stop processing: yes
When to Run
Type: New
Conditions > Recipients contains abc123@cba321.com
Actions
createRequest();
function createRequest() {
var cart = new Cart(); //calling the cart API
var item = cart.addItem('<SYSIDOFCATITEM>'); //sys_id of the catalog item I want to fire
cart.setVariable(item, 'ps_desc', email.body_text); //sets catalog variable to email's body
var rc = cart.placeOrder(); //this launches the catalog item, and creates a request object. rc = the request object
updateRITM(rc.sys_id); //call a function immediately to update the ritm. This must be a nested function, otherwise inbound actions get weird.
//also, we're passing the sys_id of the request so we know what RITM to grab.
}
function updateRITM(req){
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('request', req); //req is what we passed from the previous function. the sys_id of the request.
ritm.query();
while (ritm.next()){
ritm.opened_by = gs.getUserID();
ritm.description = "received from: " + email.origemail + "\n\n" + email.body_text;
ritm.short_description = email.subject;
ritm.requested_for = ritm.opened_by;
ritm.assignment_group = '<SYSIDOFASSIGNMENTGROUP>';
ritm.update();
}
}
function copyAttachments(cartItemID, rc) {
GlideSysAttachment.copy('sys_email', rc, 'sc_cart_item', cartItemID);
}
current.setAbortAction(true);
event.state="stop_processing";
My issue is that A user emails abc123@cba321.com which correctly creates an RITM000111 with the desired info in Short description and Description.
The abc123 team then reply to that user via email, and the user in turn replies back, but the issue is now it creates another RITM000112.
With each subsequent reply to abc123@cba321.com a new ticket is created. I want it to add the new reply as comments to the original RITM not create a new one. How do I achieve this?
I updated the Update Requested Item inbound action with the condition > recipients is abc123@cba321.com and action below, but no luck.
gs.include('validators');
if (current.getTableName() == "sc_req_item") {
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
if (gs.hasRole("itil")) {
if (email.body.assign != undefined)
current.assigned_to = email.body.assign;
if (email.body.priority != undefined && isNumeric(email.body.priority))
current.priority = email.body.priority;
}
current.update();
}
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2019 07:30 PM
Hi Matt,
Why don't you just redirect the PeopleServices@company.com address straight to ServiceNow and then manage the responses from there? That way all information would be captured in ServiceNow and the notifications managed by ServiceNow (these would contain the watermark).
If the fulfiller team is managing their work, and responding to customers directly through the exchange group email then their responses will never be captured by ServiceNow. ServiceNow will also have no way to correlate the customer replies to the original ticket and will therefore see it as a "New" email and create a duplicate ticket.
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2019 10:58 PM
You can go through the email logs to see what hindering this inbound action to run for update.
Also, please make sure that the type of inbound action is set to REPLY and not NEW.
Thanks
Gaurav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2019 03:23 PM
Yes I have it set to Reply. With the conditions for both recipeint or Subject contains some specific information. It doesn't even seem to recognise the inbound action even though it is Active.
Basically it processes the inbound email as if it is new and related to my other inbound action- It comes in and skips a few inbound actions (but it doesn't even show a skipping for the 'update requested item' action). It then stops "Stop processing detected after executing script: (mm) PS General Requests" Which is my original Inbound action.
Do i have Order wrong or something? Doesn't seem to recognise the reply Action at all?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2019 05:16 PM
So Since my first reply I did change the order and ticked stop processing, and it did indeed then show this in the log, but it was still skipped, because it is considering the reply email a 'new' email for some reason. This was definitely replied to, so not sure why it is saying it is a type: new email?
" Skipping 'Update Request Item', email is type 'new', which does not match Inbound Email Action's type 'reply' "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2019 06:22 PM
Probably a stupid question but have you confirmed that a watermark is included on the email confirming RITM has been created?
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.