I need help with JQL query to filter out test report from Test Executions for current sprint

kajaljena01 May 10, 2023

I need help with a JQL query that can filter out my Test Executions based on the environment they are run on a daily report basis. Also, the report needs to exclude test execution for any retest.

The query that I'm using is 

issuetype = Test AND issue in testExecutionTests('TestExecutionKey') AND updated > startOfDay() AND updated < now()

TestExecutionKey filter: 

issuetype = "Test Execution" AND project=XX AND fixVersion = vNext AND sprint in openSprints()

It returns the previous execution test run status rather than current execution, 

Can someone help me with it? any help would be appreciated.

1 answer

0 votes
JM Perrot
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 10, 2023

Hello @kajaljena01 and welcome among us

I can suggest some modifications, I hope they can help you

  • remplace updated > startOfDay() by created > startOfDay()
  • Try : Project = XX AND fixversion = vNext AND issuetype = Test AND sprint in openSprints() AND created > startOfDay()
  • Check your fixversion and your issuetype

Your issue is a Test or a Test Execution ?

kajaljena01 May 10, 2023

Hi JM, thanks for your suggestion. I replaced 'updated' with 'created' field but it returns 0 results.

The fix version is correct and if I try to fetch the report from test execution  (TestExecutionKey filter ) then report is matching but not when I use testExecutionTests(''). 

The issue type is Test, I'm trying to get a list of tests from Test execution. We have got multiple teams and multiple test executions created per sprint. We are using x-ray tool. I need to fetch test execution daily report for multiple projects with the same fix version and this should fetch first-time run tests only, excluding all retests for defects.  

JM Perrot
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 10, 2023

Ok so your tickets are already created before the daily test ?

In this case I can suggest to list all your project in your query :

Project in (ABC, AZE, QWE, etc...) AND fixversion = vNext AND issuetype = Test AND sprint in openSprints() AND updated > startOfDay()

kajaljena01 May 10, 2023

Im using a similar query to get test executions. 

Project in( X1, X,2) AND fixversion = vNext AND issuetype = Test AND sprint in openSprints() AND updated > startOfDay()

The report with Test execution is overall status and not daily basis. That's why I'm trying to get a list of tests executed on a daily basis and their status. 

Normally team creates test execution for the environment with no test on sprint planning day itself.

Also, added a label in Test to identify failed tests so that filter will exclude if it rerun.

The query filter issuetype = Test AND issue in testExecutionTests(filterId) looked ok until I spot the failed test which failed last Oct but report shows for today.  

I tried with different optional parameters for testExecutionTests but still, it didn't work. 

Is there any other query to retrieve the test list from test executions

JM Perrot
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 12, 2023

Re

Did you try to replace issue in testExecutionTests('TestExecutionKey') by filter = TestExecutionKey ?

kajaljena01 May 12, 2023

I tried with filter=TestExecutionkey but it still not working as expected.

For some unknown reason, it returned any previous execution where Test is attached to a defect, even though the defect itself has been closed already. Not picking the correct Test execution status.

Suggest an answer

Log in or Sign up to answer