Is there any way to set custom date in test results when they are being uploaded by “add_results_for_cases” command of TestRail API?
Because we need to upload already done test results onto TestRail server.
and get reports with plots of activities.
I have asked this before and was told no. But I will upvote that the API should be able to do this since the date of running the API will Never be when the case was run.
The timestamp of test results is always based on when the results were added via the API. We are happy to look into options to allow users to override this, although this could be problematic in many cases. You can still record such details as part of a custom field though.
Thanks for your answer.
I have some additional questions:
Is there any way to use custom fields value in the “get results” request such as GET index.php?/api/v2/get_results_for_run/1&custom_date=“12/11/2015”?
How to draw custom “Activity” in a report with the “custom date” instead of the “default date”? (if it is possible).
Is there a request which allows to get the last two results for each test case in test run?
With best regards,
Happy to help with your questions:
A server-side filter for custom fields is currently not possible with
get_results_for_runbut you can always filter on the client side. If the custom_date and creation date in TestRail are connected somehow, you could also look into using an additional created_after/created_before filter as part of the API request.
The chart always uses the built-in creation date
There’s currently no dedicated API method for this and it might be easier to use the XML exports in this case. You can alternatively also use
get_results_for_runagain but you might need to paginate through the results if you have many results (returns 250 results per requests at max).
I hope this helps!
I think it is pretty clear here Gurock designed the db scheme incorrectly and mixed meta data (date result was created) with actual data (date test case was run and results obtained.)
It is also pretty clear the solution is straight forward. Add the missing data field and by default make them the same on result creation unless an actual run date is given.
I retrieved my pw for this account to see if this issue has been fixed yet as I need to update my integration s/w to get CI/CD results into test rail.
Well it seems I am being forced to live feed my results into test rail as they happen. Which is a real poor design as many times runs have issues that need to be fixed BEFORE results are actually recorded.