QAComplete API supports filter expressions, which can be used to sort the response data in a necessary way. This can be useful when you need to process a big amount of similar items.
The operations that can work with filter expressions are listed below:
- /depts,
- /depts/{DeptId}/securitygroups,
- /depts/{DeptId}/users (GET),
- /projects/{ProjId}/users (GET).
- /projects/{ProjId}/tests/{TestId}/automations (GET),
- projects/{ProjId}/{EntityCode}/folders (GET),
- /projects/{ProjId}/defects (GET),
- /projects/{ProjId}/requirements (GET),
- /projects/{ProjId}/tests (GET),
- /projects/{ProjId}/tests/search (POST),
- /projects/{ProjId}/defects/search (POST),
- /projects/{ProjId}/requirements/search (POST).
Every item object has multiple fields which describe its attributes. QAComplete supports 4 types of fields: numeric, string, boolean, and date.
You can use both simple and complex conditions in your filter expression. Every condition covers only one QAComplete entity. It is obligatory that the field names you specify in the condition belong to this entity.
To create the simple condition, use the following syntax:
For example:
In this example, the FieldName
is FolderId, the Operation
is is not, and Value
is empty.
For the full list of possible operations for various types of fields, see below.
To create a complex condition, put multiple simple conditions into brackets and connect them with logical operators: AND, OR, or NOT. For example:
Note: |
The filter string must be URL-encoded. Spaces are encoded as %20, apostrophes as %27, and so on. For example:
Title ~ 'abc'
Title%20~%20%27abc%27
|
Operations for filter expressions
Operation | Description | Possible value | Example |
---|---|---|---|
= |
is equal |
|
AssigneeUserId = 1486 |
!= |
is not equal | AssigneeUserId != 1486 |
|
> |
is greater | NbrFiles > 2 |
|
< |
is less | NbrFiles > 5 |
|
>= |
is greater or equal | NbrNote >= 3 |
|
<= |
is less or equal | NbrNote <= 1 |
|
in |
is one of | array of numeric constants | FolderId in {329423,234435,21894} |
not in |
is not one of | FolderId not in {329423,234435,21894} |
|
is |
check for specific value | 'empty' | FolderId is empty |
is not
|
FolderId is not empty |
Operation | Description | Possible value | Example |
---|---|---|---|
= |
is equal |
|
Title = 'My issue' |
!= |
is not equal | Status != 'Active' |
|
~ |
is like | pattern | Description ~ 'Amanda' |
!~ |
is not like | Description !~ 'Orlando' |
|
in |
is one of | array of string constants | Status in {'Closed','Resolved'} |
not in |
is not one of | Status not in {'Closed','Resolved'} |
|
is |
check for specific value | 'empty' | Description is empty |
is not |
Description is not empty |
Operation | Description | Possible value | Example |
---|---|---|---|
= |
is equal | 'true' or 'false' | IsActive = true
|
!= |
is not equal | IsActive != true |
Operation | Description | Possible value | Example |
---|---|---|---|
= |
is equal |
|
DateCreated = '2015-05-12' |
!= |
is not equal | DateCreated != '2015-05-12' |
|
> |
is greater | DateCreated > '2015-05-12' |
|
< |
is less | DateCreated < '2015-05-12' |
|
>= |
is greater or equal | DateCreated >= '2015-05-12' |
|
<= |
is less or equal | DateCreated <= '2015-05-12' |
|
in |
is one of | array of date constants | DateCreated in {'2015-05-12','2015-06-12','2015-07-12','2015-08-12'} |
not in |
is not one of | DateCreated not in {'2015-05-12','2015-06-12','2015-07-12','2015-08-12'} |
|
is |
check for specific value | 'empty' | DateClosed is empty |
is not |
DateClosed is not empty |
Note: You can use predefined constants as possible values to work with Date fields:
TODAY
– The current dateNOW
– The current date and the current time