Last active
April 18, 2021 13:22
-
-
Save manvillej/443ab95988b1fc8769b54cdbf38074b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function process(/*ResolverEnvironment*/ env) { | |
gs.info("getSource: " + JSON.stringify(env.getSource())); // sys_id | |
gs.info("getArguments: " + JSON.stringify(env.getArguments())); // limit | |
var limit = parseInt(env.getArguments().limit); | |
var test_id = env.getSource(); | |
var test_result = new GlideRecord("sys_atf_test_result"); | |
if(limit || limit>0) { | |
test_result.setLimit(limit); | |
} | |
test_result.addQuery("test", test_id); | |
test_result.orderByDesc("start_time"); | |
test_result.query(); | |
var test_result_list = []; | |
while(test_result.next()) { | |
test_result_list.push(ATFGraphQLAPI.atfTestResultToJson(test_result)); | |
} | |
return { "history":test_result_list }; | |
})(env); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment