The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Replies from external vendors not getting added into RITM Ticket

AkshayB
Tera Expert

We have created few notifications which are going to watchlist users, and watchlist users might have external users.  Since they are not available on "sys_user" table in our system, their reply emails only show up as email received and do not create an additional comment in the RITM.  The requester therefore cannot see the email content and does not receive any notifications that their ticket was updated.

 

The inbound action "Update Request Item" works for the requester's reply emails, but not for external vendors since they are not present in my ServiceNow Instance.

 

What is the best way to handle this?  Any thoughts appreciated!

 

Update Request Item:

 

gs.include('validators');
if (current.getTableName() == "sc_req_item" && current.canWrite()) {
    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();
}
3 REPLIES 3

Shruti
Mega Sage
Mega Sage

Hi

Try to update inbound action script

gs.include('validators');
var watchlist = current.getValue('watch_list');

if ((current.getTableName() == "sc_req_item" && current.canWrite()) || (watchlist.indexOf(email.origemail) !== -1)) {
    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();
}

Ankur Bawiskar
Tera Patron
Tera Patron

@AkshayB 

since those are external users, hasRole() will fail and current.canWrite() will fail

check this link and it has solution

Inbound action Allow Watch list user to update incidents without an account 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Mark Manders
Mega Patron

OOB you will need access to the ticket to update it. If you aren't a user in the system, you don't have access to the ticket (since it can't validate your access) and therefor, the ticket isn't updated. You can run extra logic directly on the sys_email table, but I would use a flow for that to first do some validation if the user is in the system or not. 

On the other hand: watchlist is for 'watching'. So it's good to inform, but they shouldn't update. 
The best way to handle this, is to have a flow in place to automatically create a user when a 'non user email address' is added to the watchlist.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark