REST API: Complex project filters
From Planfix
Complex filters in REST API Planfix are used in the "/project/list" method to obtain a list of projects.
Project filters are set by the following parameters::
- type — numeric identifier of the filter.
- operator — filter operator, one of the values from the list (equal, not equal, gt, lt). Different filters can have different valid operators.
- value — filter value, which can be a string, a number, or a complex object, depending on the filter type.
- field — identifier of the custom data tag field by which the filter is performed.
Example of a request to get a list of projects with several filters by a custom field of type "Date" and a custom field of type "Employee List" (AND logic is used):
{ "offset": 0, "pageSize": 100, "fields": "id,name,description,3,5", "filters": [ { "type": 5103, "field": 3, "operator": "equal", "value": { "dateType": "otherRange", "dateFrom": "15-12-2022", "dateTo": "17-12-2022" } }, { "type": 5109, "field": 5, "operator": "equal", "value": "user:50" } ] }
Type | Name | Operators | Format value |
---|---|---|---|
5103 | Project field type "Data" |
|
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": "01-12-2022", "dateTo": "06-12-2022" } "value": { "dateType": "otherDate_withTime", "dateFrom": "30-12-2022 12:00", } |
5005 | Due date | ||
5013 | Creation date | ||
5004 | Author |
|
string - employee/contact/group number with a prefix. Например: “user:1”, “contact:5”, “group:3” |
5008 | Customer Manager | ||
5012 | Auditor | ||
5011 | Assignee | ||
5108 | Project field type "Contact" | ||
5109 | Project field type "Employee" | ||
5110 | Project field type "Counterparty" | ||
5112 | Project field type "Group, employee, contact" | ||
5113 | Project field type "Employee list" | ||
5001 | Project name |
|
string - contains/does not contain filter is applied |
5101 | Project field type "String" |
|
string - equal/not equal/ contains/does not contain filter is applied |
5007 | Project number |
|
int |
5102 | Project field type "Number" | ||
5105 | Project field type "Checklist" |
|
int - 1 / 0
boolean |
5106 | Project field type "List" |
|
string |
5107 | Project field type "Directory entry" |
|
int - entry identifier |
5115 | Project field type "Task" |
|
int - task number |
5117 | Project field type "Project" |
|
int - project number |
5002 | Project group |
|
int - group identifier |
5006 | Project status |
|
int - status identifier |
5010 | Template |
|
int - template number |
5003 | Counterparty |
|
int - counterparty number
string - counterparty number with a prefix, for example: "contact:1" |
5014 | Parent project |
|
int - Parent project number |