- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2018 11:11 AM
Hi,
How to trigger email notifications by using ATF. can you please help me how to do it
if you share the solution with Screenshots that will helpful for me
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2018 05:06 AM
Hello Chanikya,
As you know, the ATF functionality is configured in such way that all records created during the execution of an ATF tests gets automatically deleted after its completion or fail. This means that an ATF cannot send a real Email Notification to a user or at least not OOB. Under 'real' I mean you will not receive it in your email.
However, it is absolutely possible to use an ATF test to confirm if Email Notifications are being sent by the targeted ServiceNow instance.
For example - if you did any modifications on existing Email Notifications or you created custom ones -> then, you may use an ATF test to check if in reality these Notifications will be triggered if their triggering conditions are match.
I will give you a use case example:
- OOB there is an Email Notification, called "Problem assigned to me". It runs against Problem (problem) table and will be sent when a Problem record is inserted or updated + its 'Assigned to' field changes & is not 'empty'. The Notification will be sent to the assignee ('Assigned to') of the respective problem record;
- you may use an ATF test to check if this notification is actually being triggered by creating a really simple and short ATF test. Here are the steps you may use:
1. 'Impersonate' to a user with ITIL role;
2. 'Open a New Form' against Problem (problem) table;
3. 'Set Field Values' and populate the assignee of the opened problem for (Assigned to = a user with real email ID);
4. 'Submit a Form' -> this step will submit the problem form;
5. 'Record Query' -> you need to run this step against Email (sys_email) table + Conditions: Subject contains Problem & Created on is Today & Recipients contains the email of the user from step 3 (the Assignee of the Problem record);
6. 'Open an Existing Record' -> here, you need to open the record of step 5;
NOTE: Detailed description: basically, you will configure the ATF test of yours to impersonate to a user who has ITIL role. Then, this user will open a new problem record and will populate its assignee by adding a user with real email ID. Then, the test will submit the problem for in order for the new problem record to be created (inserted). After that the test will go to the Email (sys_email) table where all sent, read for sending and received Email Notification records are being stored. There, it will check for the existing of a record which was created today & which recipient was the assignee of the Problem & which has in its Subject field 'Problem'. Once such record gets found -> it will be opened and you will be able to review it. If such record is not found -> then the ATF test will fail with an error, meaning that the Notification has not been triggered due to an issue (with it or its conditions).
- during the ATF test execution (once you Run it) -> you will have to watch the steps execution via the Test Runner window in order to see the behavior is as expected;
Now, after knowing the above information, you may go ahead and configure an ATF test against a custom Email Notification of yours.
This will give you the opportunity to perform tests of any further notification customization - s on your DEV and confirm the behavior after the customization - s were done, before going forward and implementing the same on your PROD.
Hope this information will be of use to you, Chanikya!
Best Regards,
Georgi Mavrodiev
IT Consultant
Do IT Wise Bulgaria
You may visit us in our Web Site: www.doitwise.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2018 08:13 AM
We've experienced an issue where the query for the email runs too quickly, and comes up empty because it hasn't been generated yet.
Have you see this? any suggestions with the OOTB configurations? or should I try to configure a type of "delay" step?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2020 11:57 PM
Check out this video, it will clear all your doubts and help you to understand Notification queries in details.
Link: https://www.youtube.com/watch?v=MUVIsZFY0so&t=1s&ab_channel=ServiceNowHelpdesk
It help you to understand below points.
- Basic email setup
- Create an email notification
- Advanced email setup
- Advanced conditions for email notifications
- Edit HTML content in an email notification
- Document attachments on an email notification
- Preview email notifications
- Time zone for email notifications
- Specify alternative outbound email addresses for notifications
- Specify an outbound email address for a particular language
- Notification variables
- Email templates
- Email layouts
- Watermarks on notification emails
- Troubleshooting notification emails
- Trigger email through event
Please mark reply as Helpful/Correct, if applicable. Thanks!!