The CreatorCon Call for Content is officially open! Get started here.

test an inbound email action in a pre-prod ServiceNow instance

vivek11
Tera Contributor

Hi Team,
I need help to test an inbound email action in a Test Environment instance. Can some help me?

Inbound email action name = Update Idea record work notes
Table = idea


Type = Reply


Action =

if (current.getTableName() == "idea") {
    // email reply to Work Notes
    current.work_notes = "Reply from: " + email.origemail + "\n\n" + email.body_text;
        current.update();
}

 

1 ACCEPTED SOLUTION

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @vivek11 

 

  • Activate the property in Pre-Prod to enable email.

  • Ensure the shared mailbox is added in the outbound properties—emails will go to the user, and this prevents confusion.

  • Set up the email account/server in Pre-Prod.

  • Create an incident in Pre-Prod and add yourself as the caller.

  • You will receive the email in the shared mailbox defined in the property.

  • Reply from the shared mailbox and check the inbound action.

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

View solution in original post

10 REPLIES 10

Hi @Ankur Bawiskar 
Thank you for quick reply,

I have done this, but mail details in not showing in Idea Worknotes... Could you please help me?

1) You can also test by creating email record and provide all the required details.

2) Navigate to below path and click on New.




@vivek11 

are you sure your inbound action got processed or not?

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

GlideFather
Tera Patron

Hi @vivek11,

 

and is the incoming email really a reply?

You can change/simplify the conditions to increase the probability of success in order to see difference.

 

Is it adding a Work Note as required:

  • if so, then it was a problem with condition(s),
  • if not, conditions might have been ok and the problem is elsewhere..

 

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


@vivek11 and another thing I recalled is that comments and work notes might work with "+="

 

Like this:

current.work_notes += "Reply from: " + email.origemail + "\n\n" + email.body_text;

//changed from "=" to "+="


Let me know if that helped 

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Hi @GlideFather 
Thank you for reply,
Yes, incoming email really a reply

FYI = 

What It Does:

Checks if the email is related to an idea record.

Appends the email reply (including the sender and message body) to the Work Notes of that idea.