⚠️Queries are available in Business and Enterprise subscriptions

Queries based on Qase Query Language (QQL) are a way to make analytical requests to the data stored in Qase. It allows retrieving data sets for various entities using expressions with conditions.

To access the Qase Query Language page, click on the “Queries” option on the top left-hand side menu:

You will then be redirected to the main QQL page, where you can browse all the queries you have created and saved. You can then create a new query or use an existing one. To create a new query, please click on the “Create Query” button:

Once you have clicked on “Create Query”, you’ll be redirected to the page where you can enter the syntax and also save or update the queries.

QQL language structure

QQL consists of two parts: "Entity" + "Query". They both are required to perform a search query to the backend. Some examples of queries:

entity = "defect" and status = "open"

entity = "case" and project = "DEMO" and title ~ "auth" order by id desc

entity = "result" and status = "failed" and timeSpent > 5000 and
milestone ~ "Sprint 12"

entity = "case" and isFlaky = false and automation = "To be automated"

Entity by default is 'case'. Projects by default include all projects available to user

Entities

Query

Currently, QQL supports seven expression types. They are listed here in the decreasing priority order:

Expressions:

Expression Type

Example

Parenthesis

( expression )

Negation

not expression

Logical Expression

true

or

false

Logical AND

expression and expression

Logical OR

expression or expression

Checking the attribute value

attribute operand value

Sorting by field

ORDER BY field ASC/DESC

Supported operands:

Operand

Meaning

Works with

<

less than

integer

<=

less than or equal to

integer

>

greater than

integer

>=

greater than or equal to

integer

=, is

equal to

integer, bool

!=

not equal to

integer, bool

~

includes

string, text

in

includes (array)

array

not in

does not include (array)

array

is empty

no value

is not empty

value exists

Data types:

Data type

Possible values

Supported operands

Integer

110

>, >=, <, <=, =, !=

String

Some text

~

Boolean

True or False

is

Array

['Text1', 'Text2']; ('text 1', 'text 2'); []

in

Null

null

Functions:

Name

Return type

Arguments

Description

currentUser()

integer

-

Returns an ID of current user

now()

integer

"+Nd" - modifies returned value, adding N days.

"-Nd" - modifies returned value, substracting N days.

"+Nw" - modifies returned value, adding N weeks.

"-Nw" - modifies returned value, substracting N weeks.

"+Nm" - modifies returned value, adding N months.

"-Nm" - modifies returned value, substracting N months.

N must be an integer

Returns current timestamp

Entity fields

Test case:

Attribute

Description

Examples

id

identifier

id = 17
id != 20
id is 17
id in [1, 2, 10]
not id in [1, 2, 10]
title
preconditions
postconditions
description

Test case title, pre/postconditions, description

title is "first test"
title = "first test"
title ~ "rst"
title in ["first test", "second test"]
author

A user that has created a test case

author in ["user1", "user2"]
author = "user1" or author = "user2"
cf

Custom fields. A complicated attribute with a specific syntax, see examples

cf["Epic"] = "Auth"
cf["Story"] in ["Story 1", "Story 2"]
cf["Epic"] is null
cfv

Custom field values. (by all custom fields)

cfv = "Auth"
cfv in ["Story 1", "Story 2"]
status
type
behavior
automation
layer
priority
severity

Case status, type, behavior, automation, layer

status is "Draft"
status = "Active"
status != "Deprecated"
status in ["Draft", "Active"]
created

Time of case creation

created >= now("-14d")
created >= startOfDay("-1m")
created < 1569430502709
createdBy

The user who created the case

createdBy in ["user1", "user2"]
createdBy = "user1" or createdBy = "user2"
updated

Last modified date

updated >= now("-7d")
updated >= startOfDay()
updated < 1569430502709
isDeleted

Check whether the case has been deleted or not

isDeleted is false
isDeleted = true
isFlaky

Check whether the case has been flagged as flaky

isFlaky is false
isFlaky = true
project

Project's code, where to search case. If not specified, the search is performed among all available to user projects

project = 'DEMO'
project in ['DEMO', 'QTC']
project not in ['DEMO']
suite

Test case's suite title

suite ~ 'auth'
suite != 'auth'
milestone

Test case's milestone title

milestone = 'Sprint 24'
tags

Test case's tags

tags not in ['tag']

Defects:

Attribute

Description

Examples

id

identifier

id = 17
id != 20
id is 17
id in [1, 2, 10]
not id in [1, 2, 10]
title

Defect title

title is "first test"
title = "first test"
title ~ "rst"
title in ["first test", "second test"]
actual_result

Actual result

actual_result is "first"
actual_result = "first"
actual_result ~ "rst"
actual_result in ["first", "second"]
project

Project

project = 'DEMO'
project in ['DEMO', 'QTC']
project not in ['DEMO']
status

Status (open, resolved, in progress, invalid)

status is "Open"
status = "Resolved"
status != "Invalid"
status in ["Open", "Invalid"]
severity

Severity (undefined, blocker, critical, major, normal, minor, trivial)

severity is "blocker"
severity = "blocker"
severity != "blocker"
severity in ["blocker", "critical"]
author

The user who created the defect

author in ["user1", "user2"]
author = "user1"
createdBy

The user who created the defect

createdBy in ["user1", "user2"]
createdBy = "user1" or createdBy = "user2"
created

Time of creation

created >= now("-14d")
created >= startOfDay("-1m")
created < 1569430502709
updated

Time of update

updated >= now("-14d")
updated >= startOfDay("-1m")
updated < 1569430502709
resolved

Time of resolution

resolved >= now("-14d")
resolved >= startOfDay("-1m")
resolved < 1569430502709
isDeleted

Whether the defect is deleted

isDeleted is false
isDeleted = true
isResolved

Whether the defect is resolved

isResolved is false
isResolved = true
milestone

Defect's milestone title

milestone = 'Milestone title'
cfv

Custom field values (by all custom fields)

cfv = "Auth"
cfv in ["Story 1", "Story 2"]
cfv is empty
cf

Custom fields. A complicated attribute with a specific syntax, see examples

cf["Epic"] = "Auth"
cf["Story"] in ["Story 1", "Story 2"]
cf["Epic"] is null
tags

Defect's tags

tags not in ['tag']

Test Run:

Attribute

Description

Examples

id

Identifier

id = 17
id != 20
id is 17
id in [1, 2, 10]
id not in [1, 2, 10]
title

Title

title is "first test"
title = "first test"
title ~ "rst"
title in ["first test", "second test"]
description

Description

description is "first"
description = "first"
description ~ "rst"
description in ["first", "second"]
project

Project

project = 'DEMO'
project in ['DEMO', 'QTC']
project not in ['DEMO']
plan

Title of the plan used

plan = 'Regression'
status

Status

status is "Open"
status = "Resolved"
status != "Invalid"
status in ["Open", "Invalid"]
author

The user who created the run

author in ["user1", "user2"]
author = "user1" or createdBy = "user2"
createdBy

The user who created the run

createdBy in ["user1", "user2"]
createdBy = "user1" or createdBy = "user2"
started

Time of start

started >= now("-14d")
started >= startOfDay("-1m")
started < 1569430502709
ended

Time of finish

ended >= now("-14d")
ended >= startOfDay("-1m")
ended < 1569430502709
deleted

Time of removal

deleted >= now("-14d")
deleted >= startOfDay("-1m")
deleted < 1569430502709
isDeleted

Whether the run is deleted

isDeleted is false
isDeleted = true
isStarted

Whether the run is started

isStarted is false
isStarted = true
isEnded

Whether the run is ended

isEnded is false
isEnded = true
isPublic

Whether the run has a public link

isPublic is false
isPublic = true
isAutotest

Whether the run is automated

isAutotest is false
isAutotest = true
Milestone

Run's milestone title

milestone = 'Milestone title'
cfv

Custom field values (by all custom fields)

cfv = "Auth"
cfv in ["Story 1", "Story 2"]
cfv is empty
cf

Custom fields. A complicated attribute with a specific syntax, see examples

cf["Epic"] = "Auth"
cf["Story"] in ["Story 1", "Story 2"]
cf["Epic"] is null
tags

Run's tags

tags not in ['tag']

Test Run Results:

Attribute

Description

Examples

id

Identifier

id = 17
id != 20
id is 17
id in [1, 2, 10]
not id in [1, 2, 10]
comment

Comment

comment is "first test"
comment = "first test"
comment ~ "rst"
comment in ["first test", "second test"]
case

Test Run Result's case title

case is "first"
case = "first"
case ~ "rst"
case in ["first", "second"]
run

Test Run title

run is "first"
run = "first"
run ~ "rst"
run in ["first", "second"]
project

Project

project = 'DEMO'
project in ['DEMO', 'QTC']
project not in ['DEMO']
status

Status (Untested, Passed, Failed, Blocked, Retest, Skipped, Deleted, In progress, Invalid)

status is "Invalid"
status = "Invalid"
status != "Invalid"
status in ["Invalid", "Failed"]
author

The user who created the run

author in ["user1", "user2"]
author = "user1" or createdBy = "user2"
createdBy

The user who created the run

createdBy in ["user1", "user2"]
createdBy = "user1" or createdBy = "user2"
ended

Time of finish

ended >= now("-14d")
ended >= startOfDay("-1m")
ended < 1569430502709
deleted

Time of removal

deleted >= now("-14d")
deleted >= startOfDay("-1m")
deleted < 1569430502709
isDeleted

Whether the result is deleted

isDeleted is false
isDeleted = true
isEnded

Whether the result is ended

isEnded is false
isEnded = true
timeSpent

Time spent (in milliseconds)

timeSpent > 10000

Test Plan:

Attribute

Description

Examples

id

Identifier

id = 17
id != 20
id is 17
id in [1, 2, 10]
not id in [1, 2, 10]
title

Title

title is "first test"
title = "first test"
title ~ "rst"
title in ["first test", "second test"]
description

Plan's description

description is "first test"
description = "first test"
description ~ "rst"
description in ["first test", "second test"]
project

Project

project = 'DEMO'
project in ['DEMO', 'QTC']
project not in ['DEMO']
created

Time of creation

created >= now("-14d")
created >= startOfDay("-1m")
created < 1569430502709
updated

Time of the last update

updated >= now("-14d")
updated >= startOfDay("-1m")
updated < 1569430502709
deleted

Time of deletion

deleted >= now("-14d")
deleted >= startOfDay("-1m")
deleted < 1569430502709
isDeleted

Whether the plan is deleted

isDeleted is false
isDeleted = true

Requirement:

Attribute

Description

Examples

id

Identifier

id = 17
id != 20
id is 17
id in [1, 2, 10]
not id in [1, 2, 10]
parent

Parent requirement's title

parent is "first test"
parent = "first test"
parent ~ "rst"
parent in ["first test", "second test"]
project

Project

project = 'DEMO'
project in ['DEMO', 'QTC']
project not in ['DEMO']
author

The user who created the requirement

author in ["user1", "user2"]
author = "user1" or createdBy = "user2"
createdBy

The user who created the requirement

createdBy in ["user1", "user2"]
createdBy = "user1" or createdBy = "user2"
title

Title

title is "first test"
title = "first test"
title ~ "rst"
title in ["first test", "second test"]
description

Description

description is "first test"
description = "first test"
description ~ "rst"
description in ["first test", "second test"]
status

Status (valid, draft, review, rework, finish, implemented, not-testable, obsolete)

status = 'valid'
type

Type (epic, user-story, feature)

type = 'epic'
created

Time of creation

created >= now("-14d")
created >= startOfDay("-1m")
created < 1569430502709
updated

Time of last update

updated >= now("-14d")
updated >= startOfDay("-1m")
updated < 1569430502709
deleted

Time of deletion

deleted >= now("-14d")
deleted >= startOfDay("-1m")
deleted < 1569430502709
isDeleted

Whether the requirement is deleted

isDeleted is false
isDeleted = true

Examples of Queries

entity = "case" and isDeleted is true
entity = "case" and created >= now("-3d")
entity = "case" and created <= now("-3d")
entity = "case" and isDeleted is true and project in ["QTC"]
project = "QTC" and automation = "Not automated"
project = "MR" and automation != "Automated"
project = "QTC" and status in ["Draft", "Actual"]
entity = "defect" and status !="Open" and severity = "Not set"
entity = "defect" and status !=1 and severity = 0
entity = "defect" and status !=1 and severity = 0 and cfv in ["1", "2"]
entity = "defect" and status !="Open" and severity != "Not set" and milestone is empty
entity = "defect" and status !="Open" and severity != "Not set" and cf["Defect URL"] is not null
entity = "case" and author != "CEO" and updated <= now("-1d") and isFlaky is false
entity = "case" and author != "CEO" and updated <= now("-1d") and project in ('QASE', 'NQASE') and id = 1
Did this answer your question?