Qase Query Language (QQL) is a way to get to make analytical requests to the data stored in Qase. It allows retrieving data sets for various entities using expressions with conditions.
QQL language structure
QQL consists of two parts: "Entity" + "Query". They both are required to perform a search query to the backend.
Example of query:
entity = 'case' and project = 'DEMO' and title ~ 'auth' order by id desc
Entity by default is 'case'. Projects by default - all available to user projects
Entities
- Test case
- Test run
- Test run result
- Test Plan
- Defect
- Requirement
Query
Currently, QQL supports six 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 (functions in ITALIC are not yet available, will be added later):
Name | Return type | Arguments | Description |
currentUser() | integer | - | Returns an ID of current user |
now() | integer |
"+Nd" - modifies returned value, adding N days. N must be an integer |
Returns current timestamp |
startOfDay() | integer | The same modificators as for now() function plus: "Y-m-d" - modifies that date that is used for calculation |
If no arguments are provided, returns UNIX TIMESTAMP of the current day start. |
startOfWeek() | integer | The same modificators as for now() function plus: "Y-m-d" - modifies that date that is used for calculation |
If no arguments are provided, returns UNIX TIMESTAMP of the current week start. |
startOfMonth() | integer | The same modificators as for now() function plus: "Y-m-d" - modifies that date that is used for calculation |
If no arguments are provided, returns UNIX TIMESTAMP of the current month start. |
endOfDay() |
integer | The same modificators as for now() function plus: "Y-m-d" - modifies that date that is used for calculation |
If no arguments are provided, returns UNIX TIMESTAMP of the current day end. |
endOfWeek() | integer | The same modificators as for now() function plus: "Y-m-d" - modifies that date that is used for calculation |
If no arguments are provided, returns UNIX TIMESTAMP of the current week end. |
endOfMonth() | integer | The same modificators as for now() function plus: "Y-m-d" - modifies that date that is used for calculation |
If no arguments are provided, returns UNIX TIMESTAMP of the current month end. |
group() | array | "Group title" - a required param (string). | Returns a list of IDs of users that belong to a particular Group |
inactiveUsers() | array | - | Returns a list of users that are deactivated. |
activeUsers() | array | - | Returns a list of active users |
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 // Epic hasn't been specified |
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 // Epic hasn't been specified
|
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 // Epic hasn't been specified |
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"] |
caseId |
Test Run Result's case ID |
caseId = 17 caseId != 20 caseId is 17 caseId in [1, 2, 10] caseId in [1, 2, 10] |
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"] |
assignee |
The user who created the result |
assignee in ["user1", "user2"] assignee = "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 |
milestone |
Milestone which was set for the corresponding Tet Run |
milestone is "milestone title" milestone = "milestone title" milestone ~ "some text" milestone in ["first", "second"] |
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
Comments
0 comments
Please sign in to leave a comment.