jeff_lord
Giga Contributor

        I had been tasked with creating a test script for inbound email actions. Which isn't normally an issue but we do not allow access to create incidents through the email system except in specific cases. So this posed a challenge as to how we can test the inbound email action when we do not own the email that they come from. They are generated from a system and sends our instance updates of their status once a day.

        Our options were have someone dig through the emails in the system to find the one email that could be reprocessed or to build a record producer to do that for us.

With the fact that we were not wanting to do the testing ourselves because there are only 2 admins we chose to go with creating the record producer to do this for us which means anyone could test it.

So the work began:

First was to create a template from one of the emails to use in testing.

  • In doing this I learned that it was good to add what email inbox to send it to. So added the Received Inbox to the template.
  • Removed any target information

Second was to create the record producer to insert our test email and have it run

This is where I learned that just inserting the record via the template did not kick off the business rule to process the email. So using the template alone was not enough. I had to get the system to process the email once it was inserted.

Using the http://wiki.servicenow.com/index.php?title=Reprocess_Received_Emails script in the scripts section of the Record Producer allow me to have the email be processed once inserted.

Once all that was completed I just placed it out on the Service Catalog in the instance we were doing testing and directed the person executing the test script to this new catalog item in the instructions.

Hopefully this helps spark ideas.