Contributions
Add nbr_files attribute to each item in the test_run_results array for better performance
For future updates, it might be helpful for users if you add nbr_files attributeto each item in the test_run_results array that results from calling "/api/v2/projects/{ProjectId}/testruns/{Id}/items/". Then it would be possible to call any version of "get list of files" (SOAP or REST) only on items that actually contain files, which would be a good performance enhancement. See https://community.smartbear.com/t5/QAComplete-and-ALMComplete/Use-API-to-see-if-TestRunResult-has-file-s-attached/m-p/186349#M2333 for a discussion on this and why it would be a valuable addition for developers. Nastya_Khovrina798Views1like0CommentsRe: Use API to see if TestRunResult has file(s) attached
Hello Anastasia and thank you for the reply. Do I understand correctly that the method you suggests involves iterating through each element in the test_run_results array and using the id to check if there is a file attached by using REST rather than SOAP? I wasn't clear enough in my previous question, that my concern is mostly about the performance of the program. As both methods involve iterating through each item in the array and performing a "get list of files"call, is there any difference in performance between using the REST rather than SOAP api's? For future updates, it might be helpful for users if you add nbr_files to each item in the test_run_results array that results from calling "/api/v2/projects/{ProjectId}/testruns/{Id}/items/". Then it would be possible to call any version of "get list of files" only on items that actually contain files, which would be a good performance enhancement.2.5KViews0likes1CommentUse API to see if TestRunResult has file(s) attached
I am using the REST and SOAP APIs in Java code to fetch data, especially attachments, from QAComplete projects. When checking if an entity has an attachment, in most cases there is this handy json key"nbr_files" attached to the object in the Get reply. However, when I get down to test run results level, this json key is nowhere to be found. Here's an example: I call Get on: http://qacomplete.companyUrl/rest-api/service/api/v2/projects/projId/testruns/testrunId/items/itemId/ And get the following json object: ... "test_run_results": [ { "id": testRunResultId, "test_run_item_id": idNo, "seq": 1, "is_stopped_on_fail": false, "status_code": "Passed", "step": "Test data<br> <br>", "expected_result": "xxxxx", "test_step_id": idNo, "project_id": projId, "is_tokenized": false } ] ... In this test_run_result item, there is no "nbr_files" key, but I have verified that there is actually a file attached to this entity. That is I can run soap.getAttachmentList(projId, testRunResultId, "TestRunResults"); and get a list of attachments. So finally, my question is, is it possible to see if a testRunResult item has an attachment without having to call SOAP.getAttachmentList() for every item in the test_run_results array?Solved2.6KViews0likes3Comments