- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2022 02:20 AM
I'm trying to retrieve a query from a report for an ATF test I'm working on:
When I click on the number 80, it takes to the the list within the sys_user table where it contains a Related List condition, and from there I'm able to right click on the end of the filter and select 'Copy query':
However, what I'm wanting to do is use the query when I click on 'Copy query' and apply that within my ATF. i was just wondering if that is possible to do.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2022 03:40 AM
Hi
(function(outputs, steps, stepResult, assertEqual) {
var gr = new GlideRecord('sys_user');
gr.addQuery('active=true^u_employment_type=Physical Access Only^locked_out=false^RLQUERYx_snc_acc_entitle_user_account.user,<1^ENDRLQUERY');
gr.query();
var numUsers = gr.getRowCount();
if (numUsers == 0) {
stepResult.setOutputMessage("There are currently no Physcial Access Only user records that don't have a related account");
return true; // pass the step
} else {
stepResult.setOutputMessage("There are affected Physcial Access Only user records that don't have a related account. They can be found in report 'Physical Access Users with no accounts ACTIVE not Locked out'");
return false; // fail the step
}
})(outputs, steps, stepResult, assertEqual);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2022 02:26 AM
Hi,
what is the exact steps you configured so far?
What are you trying to achieve in the step which is failing?
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2022 02:33 AM
Hi
The steps I've configured so far are Creating a User and Navigating to a module which goes to the 'sys_user' table. For the step where it's failing 'Record Query', I'm wanting the step to gather the results from the following query:
active=true^u_employment_type=Physical Access Only^locked_out=false^RLQUERYx_snc_acc_entitle_user_account.user,<1^ENDRLQUERY
What I want to see is that if there are no users in the 'sys_user' table, then the ATF test passes. However, if any users do appear, then the ATF test fails.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2022 02:39 AM
Hi,
Can you share test steps you configured so far?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2022 03:03 AM