Skip Navigation LinksHome Page > Forums > SpiraTeam Forums > Spira Custom Reports > List of latest test runs ...
Hi folks
I would like the have a table with the latest test runs for each test case. Can someone help me with a ESQL query?
Hi Pierre
If you want all the test runs, with test case and execution date, something like:
select TR.TEST_CASE_ID, TR.NAME as TEST_CASE_NAME, TR.RELEASE_ID, TR.RELEASE_VERSION_NUMBER, TR.EXECUTION_STATUS_NAME, TR.TESTER_NAME, TR.END_DATE from SpiraTestEntities.R_TestRuns as TR where TR.PROJECT_ID = ${ProjectId} and TR.EXECUTION_STATUS_ID <> 3 order by TR.END_DATE desc
If you want it grouped by test case, then something like:
select TR.TEST_CASE_ID, TR.NAME as TEST_CASE_NAME, TR.RELEASE_ID, TR.RELEASE_VERSION_NUMBER, TR.EXECUTION_STATUS_NAME, TR.TESTER_NAME, TR.END_DATE from SpiraTestEntities.R_TestRuns as TR inner join (select TR.TEST_CASE_ID, max(TR.END_DATE) as LAST_EXECUTION from SpiraTestEntities.R_TestRuns as TR where TR.PROJECT_ID = ${ProjectId} and TR.EXECUTION_STATUS_ID <> 3 group by TR.TEST_CASE_ID) as GR on TR.TEST_CASE_ID = GR.TEST_CASE_ID and TR.END_DATE = GR.LAST_EXECUTION where TR.PROJECT_ID = ${ProjectId} and TR.EXECUTION_STATUS_ID <> 3 order by TR.END_DATE desc
RegardsDavid
Hi David
Thank you for your reply. It seems that your second example does exactly what i need.
For my understanding: What is the meaning of "TR.EXECUTION_STATUS_ID <> 3"
And if you have any questions, please email or call us at +1 (202) 558-6885