Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA filter to get the execution status of the last created Test Execution

Mladineo, Tonko AVL/HR
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 11, 2025

Dear Users,

I have a Test Plan (I will refer to it from now on as TPLAN-1) which is a collection of tests that are frequently run, so basically I create each day Test Execution with all tests from TPLAN-1. I would like to create a Jira Filter that can be used within gadgets to display the current status of the last created Test Execution. The problem is, that I for sure know the ID Key of my Test Plan but there are dozens of Test Executions (created daily - one for Windows and one for Linux) and I need to collect the status from the last ones created. That way I avoid incorrect status on a Test Plan level and I don't have to know the Key ID of those Test Executions. What I've tried so far:

  1. get the list of all Test Executions created from a TPLAN-1 (for Windows)
    1. issue in testPlanTestExecutions("TPLAN-1") and "Test Environments" = Win10 AND status != closed ORDER BY created DESC
    2. save the filter as te
  2. get all tests from the last Test Execution - at least i taught they are from the last TE
    1. issue in testExecutionTests("te")
      1. the problem with this filter is that it is retrieving all tests that were ever executed in any of the Test Executions created e.g. some point in time TPLAN-1 had 5 tests included and after some time one test was removed from the plan but the upper filter will anyway return 5 tests
    2. to be sure that my TE contains the same tests as ones in  the current TPLAN-1 
      1. issue in testExecutionTests("te") AND issue in testPlanTests("TPLAN-1")

 

Is there an easier way to get the status by last created Test Execution 

1 answer

0 votes
Mercy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
December 10, 2025

In Jira Data Center with Xray, JQL alone can’t dynamically pick “the latest” Test Execution because JQL doesn’t support relative ordering logic across linked issues. The function `testPlanTestExecutions("TPLAN-1")` returns all executions linked to that plan, but it doesn’t isolate the most recently created one—you’d need to explicitly reference the key. The cleanest workaround is to first identify the latest Test Execution using an ordered query like `issue in testPlanTestExecutions("TPLAN-1") AND "Test Environments" = Win10 ORDER BY created DESC`, note the top result (for example, TEX-123), and then use `issue in testExecutionTests("TEX-123")` to get its test set and statuses.

Suggest an answer

Log in or Sign up to answer