
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 05:25 AM
Email notification has been configured for creation of enhancement record. I am creating an enhancement record from below steps.
I want to validate whether the notification has been triggered or not for enhancement record created from step 3. Also I want to validate notification is triggered to assigned to of enhancement record. Could any one suggest me how I can achieve this through ATF?
Also please inform me how I can query enhancement number from ATF?
Solved! Go to Solution.
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 10:11 AM
This would be your code:
(function(outputs, steps, stepResult, assertEqual) {
var gr = new GlideRecord("rm_enhancement");
var num = steps('60f29ef0dbf527006d3c72fc0f961959').record_id; //Sys Id is mentioned here is previous step sys_id.
gr.addQuery('sys_id',num);
gr.query();
if(gr.next())
{
outputs.record_id = gr.number; //(replace with field name of number)
}
// add test script here
})(outputs, steps, stepResult, assertEqual);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 07:23 AM
Hi Ganesh
To access the enhancement number: you can get the output record_id from the step 'Submit Record Producer'. That will map to the sysID of the generated enhancement request. Then you can use the step 'Record Query' and get the respective Enhancement record and further use it to get the Number.
To validate the notification, you can use the step 'Record Query' on the notification aka sys_email table. You can create the query to check the field 'To' there and also one more condition, e.g.: Number of the Enhancement Request.
--
Best regards
Ankush
P.S. Please mark helpful/correct as appropriate to help fellow Community user in identifying useful answers.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 09:03 AM
Hi Ankush,
Whenever I am trying 'Record Query' as an output I am getting sys_id of the enhancement but not getting how to get number from that sys_id of the enhancement.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 09:10 AM
Hi Ganesh
You can use the step 'Run Server Side Step'. It has an output type record_id which is ideal to store sysID. But that can also be used to store any String less than 32 characters and hence you can use it to store Number.
--
Best regards
Ankush
P.S. Please mark helpful/correct as appropriate to help fellow Community user in identifying useful answers.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 07:33 AM
You can do as Ankush mentioned or another way is you can you use a Serverside script to glide into "sys_email" table, and if you're trying to find an enhancement record, you query by subject with the enhancement number that's been submitted from the previous step (if the email prints the enhancement number in the subject) or you can query by any field of your choice, if it finds it you can give a probably give a gs.log("found email"); statement and it'll show in the test result summary that it found the email.