REST API: Complex task filters
From Planfix
Complex task filters in REST API Planfix are used in the "/task/list" method when retrieving a list of tasks.Task filters are specified with the following parameters:
- type — numeric identifier of the filter type. The field type determines it according to
which the selection is made in the filter. The "Type" column in the table below.
- operator — filter operator, one of the values from the list (equal, notequal, gt, lt), different filters can have different allowed operators, for fields of "Date" type, you can also use the operators gtAndEqual and ltAndEqual.
- value — filter value, can be a string, a number, or a complex object, depending on the filter type.
- field — identifier of the custom field, for filters by custom fields.
- subfilter — identifier of the custom field, for filters by custom fields.
{ "type": 12, "operator": "equal", "value": { "dateType": "otherDate", "dateValue": "22-03-2022" } }
Example of a request to get a list of tasks with the transfer of multiple filters (AND logic is used):
{ "fields": "name", "filters": [{ "type": 2, "operator": "equal", "value": "user:5" }, { "type": 2, "operator": "equal", "value": "contact:7" }, { "type": 2, "operator": "equal", "value": "group:8" } ] }
Тип | Name | Operators | Format value |
---|---|---|---|
12 | Creation date |
|
Object : "value": { "dateType": string, "dateValue": string, "dateFrom": string, "dateTo": string } dateType accepts the following values:
Whether a date is considered in the past depends on the time zone of the employee who made the request. Examples: "value": { "dateType": "thisWeek" } "value": { "dateType": "otherRange", "dateFrom": "20-03-2022", "dateTo": "22-03-2022" } "value": { "dateType": "otherDate_withTime", "dateFrom": "20-03-2022 12:00", } |
13 | Planned start date | ||
14 | Planned due date | ||
21 | Date of last activity (last added comment) | ||
19 | Actual due date | ||
20 | Completion date | ||
38 | Latest change date | ||
79 | Date of the latest change or comment | ||
103 | Custom field type "Date" | ||
1 | Assigner |
|
string - employee/contact/group number with a prefix.
For example: “user:1”, “contact:5”, “group:3” |
2 | Assignee | ||
39 | Participant | ||
3 | Task or project auditor | ||
59 | Project auditor | ||
60 | Task auditor | ||
108 | Custom field type "Contact" | ||
109 | Custom field type "Employee" | ||
112 | Custom field type "Group, employee, contact" | ||
113 | Custom field type "List of employees" | ||
22 | Without a start date |
|
int - 1
boolean - true |
23 | Without a due date | ||
25 | With a start date | ||
26 | With a due date | ||
16 | Recurring | ||
28 | Non-recurring | ||
17 | Overdue | ||
29 | Not overdue | ||
33 | Without assignees | ||
41 | Without participants | ||
34 | Assigner-employee | ||
35 | Assigner-contact | ||
71 | Assignee - employee | ||
69 | Assignee - contact | ||
72 | Participant - employee | ||
70 | Participant-contact | ||
8 | Task name |
|
string - contains/does not contain filter is applied |
101 | Custom field type "String" |
|
string - equal/not equal/ contains/does not contain filter is applied |
102 | Custom field type "Number" |
|
int |
105 | Custom field type "Checkbox " |
|
int - 1 / 0
boolean |
106 | Custom field type " List" |
|
string |
107 | Custom field type "Directory entry" |
|
int - entry identifier |
114 | Custom field type "set of directory entries" |
|
int - entry identifier, for condition by several entries — identifiers through; (semicolon) |
152 | Contains a value in custom field |
|
int - field identifier |
153 | Doesn't contain a value in custom field |
|
int - field identifier |
11 | Contains a data tag |
|
int - Data tag identifier |
18 | Doesn't contain a data tag |
|
int - Data tag identifier |
73 | Direct Parent task |
|
int - Parent task number |
57 | Task number |
|
int - task number or a series of task numbers for conditions on multiple numbers (OR) |
115 | Custom field type "Task" | ||
117 | Custom field type "Project" |
|
int - project number |
51 | Template |
|
int - template number or a series of template numbers for conditions on multiple numbers (OR) |
5 | Project |
|
int - Project number |
10 | Status |
|
int - status identifier or a series of status identifiers for conditions by several statuses (OR) |
7 | Counterparty |
|
int - Counterparty number
string - counterparty number with a prefix, example: "contact:1" |
24 | Process |
|
int - process identifier |
307 | Parent task tree |
|
int - Parent task number |
9 | Priority |
|
string - Urgent or NotUrgent |
93 | The value of the data tag field |
(depending on the field type)
|
The value of the data tag field to be filtered by the subfilter field must also be passed in the filter structure; an example of filtering a data tag field of type String:
{ "offset": 0, "pageSize": 100, "filters": [ { "type": 93, "operator": "equal", "value": "Test value", "subfilter": { "dataTagId": 6, "filter": { "type": 3108, "field": 20 } } } ], "fields": "id,name,dataTags" } where:
|