Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

JQL Functions

 


The following JQL functions are available for querying Xray issues in the Issue Search Page. They provide support for querying the relation enable you to query the relationships between Xray issue types.  


JQL FunctionParametersDescriptionExample
testTestSetP1 - Test Issue KeyReturns a List list of Test Set issues associated with the input Test issue key.
issuetype = 'Test Set' 
   and key in testTestSet('DEMO-1')
testSetTestsP1 - Test Set Issue Key/Filter of Test SetsReturns a List list of Test issues associated with the input Test Set issue key.
(1) 
issuetype = 'Test'  and key in testSetTests('DEMO-5')
(2) 
issuetype = 'Test' 
   and key in testSetTests('Test sets saved filter')
testsWithNoTestSetTakes no parameterNoneReturns a List list of Test issues not associated with a Test Set .
key in testsWithNoTestSet()
testPreConditionsP1 - Test Issue KeyReturns the Pre-Condition issues associated with the input Test issue key.
issuetype = 'Pre-Condition' 
   and key in testPreConditions('DEMO-1')
preConditionTestsP1 - Pre-Condition Issue KeyReturns the Test issues associated with the input Pre-Condition issue key.
issuetype = 'Test' 
   and key in preConditionTests('DEMO-1')
testRequirementsP1 - Test Issue KeyReturns a List list of Requirement issues associated with the input Test issue key.
issuetype = 'Feature' 
   and key in testRequirements('DEMO-1')
requirementTestsP1 - Requirement Issue Key/Filter of Requirement IssuesReturns a List list of Test issues associated with the input Requirement issue key or saved filter with Requirements.
(1)
issuetype = 'Test' 
   and key in requirementTests('DEMO-10')
(2)
issuetype = 'Test' 
   and key in requirementTests('Requirements saved filter')
testsWithReqVersion

P1 - Project Name/Key/Id

P2 - Fix Version 

P3 - Fix Version (Optional)

...

Pn - Fix Version (Optional)

Returns a List list of Test issues associated with the Requirement issues with issues of the input Fix Versions and in the provided Versions of the specified project.
issuetype = 'Test' 
   and issue in 
   testsWithReqVersion('DEMO', 
                       'v1.0', 'v1.1')
testsWithTestSetVersion

P1 - Project Name/Key/Id

P2 - Fix Version 

P3 - Fix Version (Optional)

...

Pn - Fix Version (Optional)

Returns a List of Test issues associated with the Test Set issues with issues of the input Fix Versions and in the provided of the specified project.
issuetype = 'Test' 
   and issue in 
   testsWithTestSetVersion( 'DEMO', 
                           'v1.0', 'v1.1')
testExecutionTests

P1 - Test Execution Issue Key/Id or Filter IdID

P2 - Test Run Status list separated by "|"(pipe) (Optional)

P3 - User assigned to execute Test Run (Optional). If you pass "" as argument then the function will look for unassigned Test Runs

P4 - Defects Flag with value in true or false (optional).

P5 - User who executed the Test Run (optional).

Returns a List of Test issues associated with the input Test Execution issues from P1 optionally filtered by the current test run status for each Test issue.

Parameter P1 can either be a single Test Execution issue key, an ID or Id or a saved filter containing multiple Test Execution issues.

The possible Possible Test Run Status values are: PASS, FAIL, EXECUTING, ABORTED, TODO and all custom statuses.

The P3 corresponds to the user assigned to the execution of Test Runto execute the Test Run, while P5 corresponds to the one who actually executed it.

If you pass true as the value for P4, the query returns  all Tests from a particular set of Test Execution Executions that have been failed but no Defects were created.

(1)
issuetype = 'Test' 
   and issue in testExecutionTests('DEMO-9')

(2)

issuetype = 'Test' 
   and issue in testExecutionTests('DEMO-9', 
                                   'PASS')

(3)

issuetype = 'Test' 
   and issue in testExecutionTests('DEMO-9', 
                                   'PASS', 
                                    'user A')

(4)

issuetype = 'Test' 
   and issue in testExecutionTests(
                      'Saved Test Execution Filter', 
                      'PASS')

(5)

issuetype = 'Test' 
   and issue in testExecutionTests(
                      'Saved Test Execution Filter', 
                      '',
                      'user A')

(6)

issue in testExecutionTests(
                      'Saved Test Execution Filter', 
                      '',
                      'user A', 'true')
testsWithoutTestExecutionTakes no parameterReturns a list of Tests that are not associated with a Test Execution to be executed

(

1

7)

issuetypeissue = Test and issue in testsWithoutTestExecution()in testExecutionTests(
                      'Saved Test Execution Filter', 
                      '','', 'false', 'admin')
testsWithoutTestExecutionNoneReturns a list of Tests that are not associated with a Test Execution to be executed
(1)
issuetype = Test and issue in testsWithoutTestExecution()
requirements

P1 - Status list separated by "|"(pipe)

P2 - Project (Optional)

P3 - Version to calculate requirement status (Optional)

P4 - Test Environment (Optional)

P5 - Flat (Optional)

P6 - ToDate (Optional)


Returns a list of Requirement Issues with the provided coverage status.

If a specific analysis version is required, then the Project and Version parameters must be filled.


Optional filters include:

Test Environment, for taking into account the Test Executions made for that environment. For analyzing the joint values of all environments, "" should be used. For taking into account the Test Executions without any Test Environment assigned, then "__NULL__" should be used.

Flat that indicates whether all Requirements (not only parents) should be searched. If "Flat" is not provided, the default value is 'false'.

ToDate considers only those requirements executions before a specific date/time (the date literal must follow the ISO8601 format).

(1)
issue in requirements('OK')
(2)
priority = Major and fixVersion <= 'v3.0' and
   issue in requirements('NOK', 'Calculator', 'V4.0')
(3)
issue in 
   requirements('NOK', '', '', '', '','2014-01-01')
(4
requirements

P1 - Status list separated by "|"(pipe)

P2 - Project (Optional)

P3 - Version to calculate requirement status (Optional)

P4 - Test Environment (Optional)

P5 - Flat (Optional)

P6 - ToDate (Optional)

 

Returns a list of Requirement Issues with the provided coverage status.

If a specific analysis version is required, then the Project and Version parameters must be filled.

Optional additional filters are:

Test Environment, for taking into account the Test Executions made for that environment. For analysing the joint values of all environments, "" should be used. For taking into account the Test Executions without any Test Environment assigned, then "__NULL__" should be used.

Flat that indicates whether all Requirements (not only parents) should be searched. If the flat "Flat" is not provided, the default value is 'false' .

ToDate to consider only requirements executions before a specific date/time (the date literal must follow the ISO8601 format).

(1)
issue in requirements('OK')
(2)
priority = Major and fixVersion <= 'v3.0' and
   issue in requirements('NOK', 'Calculator', 'V4.0')
(3)
issue in 
   requirements('NOK', '', '', '', '','2014-01-01')
(4)
issue in 
   requirements('OK',
             'Calculator',  
             'v1.0',
             'chrome' 
             'false'
             '2014-08-30')
(5)
issue in 
   requirements('NOKOK',
             'Calculator',  
             'v2v1.0',
             'chrome', 
             'truefalse')
             '2014-08-30')
(5)
issue in 
   requirements('NOK',
             'Calculator',  
             'v2.0',
'',
             'true')
requirementsWithStatusByTestPlan

P1 - Status list separated by "|"(pipe)

P2 - Test Plan Issue Key

P3 - Test Environment (Optional)

P4 - Flat (Optional)

P5 - ToDate (Optional)


Returns a list of Requirement Issues with the coverage status calculated for the given Test Plan issue.


Optional filters include:

Test Environment

requirementsWithStatusByTestPlan

P1 - Status list separated by "|"(pipe)

P2 - Test Plan Issue Key

P3 - Test Environment (Optional)

P4 - Flat (Optional)

P5 - ToDate (Optional)

 

Returns a list of Requirement Issues with the provided coverage status calculated for the given Test Plan issue.

Optional additional filters are:

Test Environment, for taking into account the Test Executions made for that environment. For analysing analyzing the joint values of all environments, "" should be used. For taking into account the Test Executions without any Test Environment assigned, then "__NULL__" should be used.

Flat that indicates whether all Requirements (not only parents) should be searched. If the flat "Flat" is not provided, the default value is 'false'.

ToDate to consider considers only those requirements executions before a specific date/time (the date literal must follow the ISO8601 format).


(1)
issue in 
    requirementsWithStatusByTestPlan('OK', 'TP-123')
(2)
issue in 
    requirementsWithStatusByTestPlan('NOK', 'NOK', 
                                    'TP-123',
                                    'TP-123',
                                    'true')

(3)

issue in 
    requirementsWithStatusByTestPlan('NOK', 
                                    'true')

(3)

issue in 
TP-123', 
                   requirementsWithStatusByTestPlan('NOK',                 'Android',
                    'TP-123',                'false',
                     'Android',               '2014-01-01')

defectsCreatedDuringTesting

P1 - Test Issue Key/Filter of Test IssuesReturn a list of defects created during the execution of Tests.
(1)
issue in                    'false',
                                    '2014-01-01')

defectsCreatedDuringTesting

P1 - Test Issue Key/Filter of Test Issues
defectsCreatedDuringTesting()
(2) 
issue in defectsCreatedDuringTesting("TEST-123") 
(3) 
issue in defectsCreatedDuringTesting("saved_filter")
defectsCreatedDuringTestExecution

P1 - Test Execution issue Key or Test Execution based Filter

P2 - List of users separated by "|" (pipe). (Optional)

Returns a list of Defects created in the execution page and can optionally be filtered by the Defect Issue Assignee username.

(1) issue in 
   defectsCreatedDuringTestExecution(TEST-123)
(2) issue in 
   defectsCreatedDuringTestExecution(saved_filter)
(3) issue in 
   defectsCreatedDuringTestExecution(saved_filter, 'user1|user2')
(4) issue in 
   defectsCreatedDuringTestExecution(TEST-123, 'user1|user2')
 

defectsCreatedForRequirement

P1 - Requirement key or saved filterReturns Return a list of defects created during the execution of Teststesting of specific requirements.
(1
(1)
issue in defectsCreatedDuringTesting()
(2) 
issue in defectsCreatedDuringTestingdefectsCreatedForRequirement("TESTREQ-123") 
(32) 
issue in defectsCreatedDuringTestingdefectsCreatedForRequirement("saved_filter"))
manualTestsWithoutStepsNoneReturns a list of manual tests that have no test steps.
issue in manualTestsWithoutSteps()
testTestExecutions defectsCreatedDuringTestExecution

P1 - Test Execution issue Issue Key/Id or Test Execution based Filter Name/Id

P2 - List of users Test Run Status list separated by "|"(pipe). It is an optional parameter.(Optional)

Returns a list of Defects created in the execution page and can optionally be filtered by the Defect Issue Assignee username passing the P2 parameter.

(1) issue in 
   defectsCreatedDuringTestExecution(TEST-123)
(2) issue in 
   defectsCreatedDuringTestExecution(saved_filter)
(3) issue in 
   defectsCreatedDuringTestExecution(saved_filter, 'user1|user2')
(4) issue in 
   defectsCreatedDuringTestExecution(TEST-123, 'user1|user2')
 

defectsCreatedForRequirement

P1 - Requirement key or saved filterReturn a list of defects created during the testing of specific requirements
(1) 
issue in defectsCreatedForRequirement("REQ-123")
(2) 
issue in defectsCreatedForRequirement("saved_filter")
manualTestsWithoutStepsTakes no parameterReturns a list of manual tests that have no test steps.
issue in manualTestsWithoutSteps()

test executions associated with the input Test Issues from P1 optionally filtered by the current test run status for each Test issue.

Parameter P1 can either be a single Test issue key or Id or a saved filter name or id containing multiple Test Execution issues.

Possible Test Run Status values are: PASS, FAIL, EXECUTING, ABORTED, TODO and all custom statuses.

(1)
issuetype = 'Test Execution' 
   and issue in testTestExecutions('DEMO-9')

(2)

issuetype = 'Test Execution' 
   and issue in testTestExecutions('DEMO-9', 
                                   'PASS')

(3)

issuetype = 'Test Execution' 
   and issue in testTestExecutions(
                      'Saved Test Filter', 
                      'PASS')
testExecWithTestRunsAssignedToUser 

P1 - Username (Optional)

P2 - Status (Optional) Username is required in case we use this parameter

Returns a list of test executions where a user has at least one test run assigned to him. You can optionally specify a user with P1, or if the user is omitted the current user will be used. Note that if you are not logged in to JIRA, a user must be specified.

If you use status parameter then user is required

(1)

issuetype = 'Test Execution' and
  issue in testExecWithTestRunsAssignedToUser()

(2

testTestExecutions 

P1 - Test Issue Key/Id or Filter Name/Id

P2 - Test Run Status list separated by "|"(pipe) (Optional)

Returns a list of test executions associated with the input Test Issues from P1 optionally filtered by the current test run status for each Test issue.

Parameter P1 can either be a single Test issue key or Id or a saved filter name or id containing multiple Test Execution issues.

The possible Test Run Status are: PASS, FAIL, EXECUTING, ABORTED, TODO and all custom statuses.

(1)
issuetype = 'Test Execution' 
   and issue in testTestExecutions('DEMO-9')

(2)

issuetype = 'Test Execution' 
   and issue in testTestExecutions('DEMO-9', 
                                   'PASS')

(3)

issuetype = 'Test Execution'  and
   and issue in testTestExecutionstestExecWithTestRunsAssignedToUser(
                      'Saved Test Filter', 
                      'PASS')
testExecWithTestRunsAssignedToUser 

P1 - Username (Optional)

P2 - Status (Optional) Username is required in case we use this parameter

Returns a list of test executions where a user has at least one test run assigned to him. You can optionally specify a user with P1, or if the user is omitted the current user will be used. Note that if you are not logged in to JIRA, a user must be specified.

If you use status parameter then user is required

'userDPC')

(3)

issuetype = 'Test Execution' and
  issue in testExecWithTestRunsAssignedToUser('userDPC', "FAIL")
testSetPartiallyIn
P1 - Test Execution Issue Key/Test Plan Issue Key/Id or Filter IdReturn a list of Test Sets that have at least one test in P1.

(1)

issuetype = 'Test Set' and
  issue in testSetPartiallyIn('DEMO-15')

(2)

issuetype = 'Test Set' and
  issue in testSetPartiallyIn('testExecList')

(3)

issuetype = 'Test Set' and
  issue in testSetPartiallyIn('testPlanList')
testSetFullyIn
P1 - Test Execution Issue Key/Test Plan Issue Key/Id or Filter IdReturn a list of Test Sets that have all its tests in P1.

(1)

issuetype = 'Test Set' and
  issue in testSetFullyIn('DEMO-15')

(2(1)

issuetype = 'Test ExecutionSet' and
  issue in testExecWithTestRunsAssignedToUsertestSetFullyIn('testExecList')

(23)

issuetype = 'Test ExecutionSet' and
  issue in testExecWithTestRunsAssignedToUser('userDPC')

(3)

issuetype = 'Test Execution' and
  issue in testExecWithTestRunsAssignedToUser('userDPC', "FAIL")
testSetPartiallyIn
P1 - Test Execution Issue Key/Test Plan Issue Key/Id or Filter IdReturn a list of Test Sets that have at least one test in P1.
 in testSetFullyIn('testPlanList')
testPlanTests

P1 - Test Plan Key or Filter Name

P2 - Status (Optional)

P3 - Environment (Optional)

Returns a list of tests that are associated with the test plan chosen or the JIRA Filter name.

The "status" parameter is optional and allows to filter Test issues in a specific Plan with the specified execution status. If the "status" parameter is present, users might also pass the "environment" parameter. If this parameter is filled, Xray will provide all Tests in a Test Plan that are in the specified "status" and for the specified "environment".

(1)

issue in testPlanTests("DEMO-10"

(1)

issuetype = 'Test Set' and
  issue in testSetPartiallyIn('DEMO-15')

(2)

issuetypeissue in testPlanTests("DEMO-10","TODO")

(3)

= 'Test Set' and  issue in testSetPartiallyIn('testExecList')

(3)

issuetype = 'Test Set' and
testPlanTests("DEMO-10","TODO","IOS")
testPlanTestExecutionsP1 - Test Plan Key

Returns a list of test executions that are associated with the test plan.

  issue in testSetPartiallyIn('testPlanList')testPlanTestExecutions("DEMO-10")

testPlanRequirements

P1 - Test Plan Key/Filter of Test PlansReturns the Requirement issues that are indirectly associated, through Test issues, with a Test Plan or a saved filter of Test Plans
testSetFullyIn
P1 - Test Execution Issue Key/Test Plan Issue Key/Id or Filter IdReturn a list of Test Sets that have all its tests in P1.

(1)

issuetype = 'Test Set' and
  issue in testSetFullyIntestPlanRequirements('"DEMO-15'20")
(
2)
2)
issuetype = 'Test Set' and
  issue in testSetFullyIn('testExecList')
(3)
testPlanRequirements("Test Plans saved filter")

testTestPlanP1 - Test Issue KeyReturns a List of Test Plan issues associated with the input Test issue key.
issuetype = 'Test SetPlan' 
   and key issue in testSetFullyIntestTestPlan('testPlanListDEMO-1')
testPlanTests

testRepositoryFolderTests

P1 - Test Plan Project Key

P2 - Status (Optional)Folder Path

P3 - Environment (Optional)

Returns a list of tests that are associated with the test plan.

The "status" parameter is optional and allows to filter Test issues in a specific Plan with the specified execution status. If the "status" parameter is present, users might also pass the "environment" parameter. If this parameter is filled Xray will provide all Tests in a Test Plan that are in the specified "status" and for the specified "environment".

(1)

issue in testPlanTests("DEMO-10")

(2)

issue in testPlanTests("DEMO-10","TODO")

(3)

issue in testPlanTests("DEMO-10","TODO","IOS")
testPlanTestExecutionsP1 - Test Plan Key

Returns a list of test executions that are associated with the test plan.

issue in testPlanTestExecutions("DEMO-10")

Flatten (Optional)

Returns the list of Tests contained in a folder (P2) of the Test Repository of a Project (P1)

May optionally include the Tests in sub-folders by setting Flatten (P3) to "true".

(1)

issue in testRepositoryFolderTests("CALC", 'Parent/Child')

(2)

issue in testRepositoryFolderTests("CALC", 'Parent/Child', "true")

testPlanFolderTests

P1 - Test Plan Key

P2 - Folder Path

P3 - Flatten (Optional)

P4 - Test Run Status (Optional)

P5 - Test Environment (Optional)

Returns the list of Tests contained in a folder (P2) of a Test Plan (P1).

May optionally include the Tests in sub-folders by setting Flatten (P3) to "true".

Can also filter by Tests Run Status (P4) for a given Test Environment (P5).

To analyze the joint values of all Test Environments, "" should be used. To analyze the Test Executions without any Test Environment assigned, then "__NULL__" should be used

testPlanRequirements

P1 - Test Plan Key/Filter of Test PlansReturns the Requirement issues that are indirectly associated, through Test issues, with a Test Plan or a saved filter of Test Plans

.


(1)

issue

in

testPlanRequirements

testPlanFolderTests(

"DEMO-20"

CALC-10, 'Parent/Child')

(2)

issue

in

testPlanRequirements("Test Plans saved filter")
testTestPlanP1 - Test Issue KeyReturns a List of Test Plan issues associated with the input Test issue key.
issuetype = 'Test Plan' 
   and key in testTestPlan('DEMO-1')

 

Custom Fields

 

testPlanFolderTests(CALC-10, 'Parent/Child', "true")

(3)

issue in testPlanFolderTests(CALC-10, 'Parent/Child', "true", "TODO|FAIL", "windows")


Custom Fields


Xray also provides Xray also provides queriable custom fields to allow more refined queries when searching for issues.

JQL FunctionIssue TypeDescriptionExample
Test TypeTestThe Test type: Manual;Automated[Cucumber];Automated[Generic]
issuetype = 'Test' 
   and "Test Type" = "Manual"
TestRunStatusTest

This is a calculated custom field that provides the latest Test Run status based on the current "Test Run Status Version Strategy" option configured in the Xray administration.

 

 



Info
titleTest Run Status
The latest Test Run Status is calculated based on the latest final Test Run (i.e., latest finish date) or, in case there are no final Test Runs, the latest non-final Test Run (i.e., latest start date). Please see the custom fields preferences page.
issuetype = 'Test' 
   and TestRunStatus in ("FAIL", "ABORTED")

_

issuetype = 'Test' 
   and TestRunStatus = "PASS"

_

issuetype = 'Test' 
   and TestRunStatus is EMPTY
Requirement StatusRequirement

This is a calculated custom field that provides the requirement coverage status.

The possible Possible status values are:

OK - All tests are passed for the requirement

NOK - At least one test failed

NOTRUN - At least one test is test did not run

UNCOVERED - The requirements is not associated with tests

testTestExecutions 

 


Info
titleRequirement Coverage

For more infoinformation, please see please check out our page dedicated to requirement requirements coverage.

If the Requirement Requirements Coverage Strategy  depends on the version, then you must also include the actual version name and the status when you do the search value in the form. The syntax: "[version name] - [status]"

issuetype = 'New Feature' 
   and "Requirement Status" = "OK"
_
issuetype = 'New Feature' 
   and "Requirement Status" in ("NOTRUN", "UNCOVERED")

_

issuetype = 'New Feature' 
   and "Requirement Status" = "v1.0 - OK"
Steps CountTestThe number of Steps in a Manual Test
issuetype = 'Test' 
   and "Steps Count" = 3

 

...



Note

The custom fields "Test Set Status" and "Test Plan Status" custom fields, mentioned in Custom Fields Preferences, are not queriable.

 

 

 

queryable.