Edit a filter

This request allows you to change the parameters of an issue filter.

PATCH

https://api.tracker.yandex.net/v3/filters/<filter_id>

Warning

When you edit a filter, the filter parameter is replaced entirely, not partially updated. To keep the existing filter conditions and add new ones, pass all conditions in the request — both old and new.

Request format

Before making the request, get access to the API.

To edit a filter, use an HTTP request with the PATCH method. Specify parameters in JSON format in the request body.

PATCH /v3/filters/<filter_id>
Host: api.tracker.yandex.net
Authorization: OAuth y0__xAbc******
Content-Type: application/json
X-Org-ID or X-Cloud-Org-ID: <organization_ID>

{
    "name": "<new_filter_name>",
    "filter": {
        "status": "open"
    }
}
Headers
  • Host: address of the node that provides the API.

  • Authorization: Authorization token about these formats:

    • OAuth <OAuth_token>: For authorization using the OAuth 2.0 protocol. Learn more

    • Bearer <IAM_token>: For authorization using an IAM token, if a Yandex Cloud Organization organization is linked to Tracker. Learn more

  • X-Org-ID or X-Cloud-Org-ID: Organization ID.

    • Use the X-Org-ID header if a Tracker organization is linked to Yandex 360 for Business.

    • Use the X-Cloud-Org-ID header if a Tracker organization is linked to Yandex Cloud Organization.

    To get the organization ID, go to AdministrationOrganizations and copy the value from the ID field.

Request parameters

Required parameters

Parameter Description Data type
<filter_id> Filter ID. Number
Request body parameters

A JSON object with the editable filter parameters is passed in the request body.

Additional parameters

Parameter

Description

Data type

filter

An object with filtering parameters that defines issue selection criteria — which issues appear in the filter results. The object keys are issue field names, and the values are filtering conditions for those fields.

For the full list of supported parameters, see the https://tracker.yandex.com/admin/fields page.

Example values for different field types:

  • Text fields and users: "assignee": "me()", "assignee": "userlogin", "createdBy": "username"
  • Statuses and enumerations: "status": "open" or an array "status": ["open", "inProgress"]
  • Dates: "created": "2024-01-01..2024-12-31" (date range)

Object

query

Filter conditions in query language format.

String

fields

The list of issue fields to display in the Tracker user interface. For example: ["key", "summary", "status", "assignee", "priority", "created", "updated"].

The fields parameter only affects the display in the Tracker interface; it doesn't affect API request results. When using a filter via the API (the /v2/issues/_search method), issue fields are returned based on the parameters passed in the _search method call.

Array of strings

sorts

An array of objects for sorting results.

Array of objects

groupBy

The field for grouping results.

String or object

folder

The folder where the filter will be saved.

String or object

Note

You can use either the query parameter or the filter parameter. Using both parameters at the same time isn't supported.

Fields of the sorts object

Parameter Description Data type
field The key of the issue field to sort by. String
isAscending Sorting order: true — ascending, false — descending. Boolean

Example 1: Change the filter name

  • The HTTP PATCH method is used.
  • The filter with ID 12345 is edited.
  • Only the name parameter (the filter name) is changed.
  • filter object: not specified, so the filtering conditions remain unchanged.
PATCH /v3/filters/12345 HTTP/1.1
Host: api.tracker.yandex.net
Authorization: OAuth y0__xAbc******
Content-Type: application/json
X-Org-ID or X-Cloud-Org-ID: <organization_ID>

{
    "name": "New filter name"
}

Example 2: Change filter conditions

  • The HTTP PATCH method is used.
  • The filter with ID 12345 is edited.
  • Goal: change the filter so that it shows high-priority issues assigned to the current user.
  • filter object: two new conditions are set:
    • Priority is critical (critical)
    • Assignee is the current user (me())
  • Important: the filter parameter replaces conditions completely. All previous filter conditions are removed.
PATCH /v3/filters/12345 HTTP/1.1
Host: api.tracker.yandex.net
Authorization: OAuth y0__xAbc******
Content-Type: application/json
X-Org-ID or X-Cloud-Org-ID: <organization_ID>

{
    "filter": {
        "priority": "critical",
        "assignee": "me()"
    }
}

Example 3: Add sorting by priority

  • The HTTP PATCH method is used.
  • The filter with ID 12345 is edited.
  • Goal: add sorting by priority (from highest to lowest) to an existing filter.
  • sorts parameter: sorting results by the priority field in descending order (isAscending: false) is added.
  • Note: this example doesn't specify the filter parameter, so the existing filter conditions remain unchanged. Only the sorting is changed.
PATCH /v3/filters/12345 HTTP/1.1
Host: api.tracker.yandex.net
Authorization: OAuth y0__xAbc******
Content-Type: application/json
X-Org-ID or X-Cloud-Org-ID: <organization_ID>

{
    "sorts": [
        {
            "field": "priority",
            "isAscending": false
        }
    ]
}

Response format

If the request is successful, the API returns a response with code 200 OK.

The response body contains information about the updated filter in JSON format.

{
    "id": 12345,
    "self": "https://api.tracker.yandex.net/v3/filters/12345",
    "name": "New filter name",
    "filter": {
        "assignee": "me()",
        "status": "open"
    },
    "sorts": [
        {
            "field": {
                "self": "https://api.tracker.yandex.net/v3/fields/priority",
                "id": "priority",
                "display": "Priority"
            },
            "isAscending": false
        }
    ],
    "favorite": false,
    "permissions": {
        "WRITE": {
            "users": [
                {
                    "self": "https://api.tracker.yandex.net/v3/users/1234567890",
                    "id": "1234567890",
                    "display": "User Name",
                    "cloudUid": "ajevuhegoiuhfasjhiu",
                    "passportUid": 1234567890
                }
            ],
            "groups": [],
            "roles": []
        },
        "READ": {
            "users": [],
            "groups": [
                {
                    "self": "https://api.tracker.yandex.net/v3/groups/5",
                    "id": "5",
                    "display": "All employees"
                }
            ],
            "roles": []
        }
    },
    "owner": {
        "self": "https://api.tracker.yandex.net/v3/users/1234567890",
        "id": "1234567890",
        "display": "User Name",
        "cloudUid": "ajevuhegoiuhfasjhiu",
        "passportUid": 1234567890
    }
}
Response parameters
Parameter Description Data type
id Filter ID. Number
self The address of the API resource that contains information about the filter. String
name Filter name. String
filter An object with filter conditions. Object
sorts An array of objects for sorting results. Returned if sorting is configured for the filter. Array of objects
favorite Favorite filter flag: true — the filter is added to favorites, false — not added. Boolean
permissions An object with information about filter access permissions. Object
owner An object with information about the filter owner. Object

Fields of objects in the sorts array

Parameter Description Data type
field An object with information about the field to sort by. Object
isAscending Sorting order: true — ascending, false — descending. Boolean

Fields of the field object

Parameter Description Data type
self The address of the API resource that contains information about the field. String
id Field ID. String
display Display name of the field. String

Fields of the permissions object

Parameter Description Data type
WRITE An object with information about permissions to edit the filter. Object
READ An object with information about permissions to read the filter. Object

Fields of the WRITE and READ objects

Parameter Description Data type
users An array of users with the corresponding permissions. Array of objects
groups An array of groups with the corresponding permissions. Array of objects
roles An array of roles with the corresponding permissions. Array of objects

Fields of the owner object

Parameter Description Data type
self Address of the API resource with information about the user String
id User ID. String
display Displayed user name String
passportUid Unique ID of the user account in the Yandex 360 for Business organization and Yandex ID. Number
cloudUid Unique user ID in Yandex Cloud Organization String

If the request wasn't processed successfully, the API returns a response with an error code:

400
One or more request parameters have an invalid value.
401
The user is not authorized. Make sure that actions described in the API access section are performed.
403
You are not authorized to perform this action. You can check what rights you have in the Tracker interface. The same rights are required to perform an action via the API and interface.
404
The requested object was not found. You may have specified an invalid object ID or key.