Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

Inbound Action for Email processing help

BrianS344076034
Tera Guru

Hello, our team has created a custom group / app for HR that allows them to create tickets etc.

Its designed so the HR person can reply to the person from the incident and then the user can reply back, works like the incident table for all intents, but HR has noted that when a user replies, the ticket is not updated.


What I can see is the email reply is getting added to the case in the email related items, but the actual update from the email is not getting added to the comments.


This is what I tried so far and not having much like

Flow Designer

Trigger - inbound email

Type is received

Target Table is x_cinep_workday (custom table)

 

Look up 

Sys ID is Trigger ... Sys ID

Update Workday Incident Record

 

This works if I'm the one who replies to a ticket in my name with HR....but not for anyone else

 

Then I tried Inbound Actions

 

Name - Update Workday Ticket

Target Table - Custom table

Action Type - Record Action

 

When to run

Type - Reply

Target table - custom table

Type is recieved

 

Actions

gs.include('validators');

if (current.getTableName() == "Workday Incident") {
    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;
    }

    if (current.canWrite())
        current.update();
}

 

 

but it still doesn't seem to process any replies, any thoughts?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@BrianS344076034 

in this line it should be table name and not table label

if (current.getTableName() == "Workday Incident") {

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@BrianS344076034 

in this line it should be table name and not table label

if (current.getTableName() == "Workday Incident") {

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

updated to 

gs.include('validators');

if (current.getTableName() == "x_cinep_workday_in_workday_incident") {
    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;
    }

    if (current.canWrite())
        current.update();
}
 
now have to get someone to test