Checking email notification for ATF? If I use the 'Create a User' step, is there a way to verify if an email notification has been sent for that user in ATF if a notification is supposed to be sent?

Justin1
Kilo Expert

Is there a way to test email notifications for a user I created in ATF?

1 ACCEPTED SOLUTION

Hi Justin,

I've encountered this exact scenario. Unfortunately, the 'Create a User' step does not let you set the user's email address. What I did to get around this was to use a 'Record Insert' step to insert a record into the sys_user table, where I set the user's email address. It does not have to be a realistic email address.

Then my email query was able to find the inserted user's fake email address under 'Recipients'.

ServiceNow ATF rolls back so my user record insert was rolled back/deleted at the end of my Test.

View solution in original post

6 REPLIES 6

Hi Justin,

Yes you can set the Group within the same 'Record Insert'. Just set the 'Primary Assignment Group' field value to the name of the Group. Obviously, the Group should have the relevant roles, so the inserted user will automatically gain those roles. I find it much easier to keep it all in the same 'Record Insert' rather than having a 2nd 'Record Insert' into the sys_user_has_role table.

Gerald Onyia
Kilo Guru

In addition to the other comment...

If you are trying to query an email for a particular record created, you can reference the 'Target' field to the record that was created in an earlier step. This will pull the email(s) for the exact record.

You can also query the 'Recipients' field by setting the 'Recipients' to CONTAINS the user's email address.

I would suggest combining both the 'Target' and 'Recipients' to pull the precise email record. Pulling only the 'Recipients' will query all email records for that person.