Updating an entity
Use this request to update information about an entity: a project or project portfolio.
The request is a unified method for updating project and portfolio information – more flexible and functional than the updating project information API.
Request format
Before making a request, get permission to access the API.
To update an entity, use an HTTP PATCH
request. Request parameters are provided in the request body in JSON format.
PATCH /v2/entities/<entity_type>/<entity_ID>
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth token>
X-Org-ID: <organization ID>
{
"fields":
{
"summary": "<new_name>",
"teamAcceess": true
},
"comment":"<comment>",
"links":
[
{
"relationship": "<link>",
"entity": "<linked_entity_ID>"
}
]
}
-
Host
Address of the node that provides the API:
https://api.tracker.yandex.net
-
Authorization
OAuth token in
OAuth <OAuth_token>
format, e.g.:OAuth 0c4181a7c2cf4521964a72ff********
-
X-Org-ID or X-Cloud-Org-ID
Organization ID. You can find it out on the Tracker organizations page
.- If a Yandex 360 for Business organization is the only one linked to Tracker, the
X-Org-ID
header is used. - If a Yandex Cloud Organization organization is the only one linked to Tracker, the
X-Cloud-Org-ID
header is used. - If both Yandex 360 for Business and Yandex Cloud Organization organizations are linked to Tracker at the same time, the
X-Org-ID
header and the Yandex 360 for Business organization ID are used.
- If a Yandex 360 for Business organization is the only one linked to Tracker, the
Parameter | Description | Data type |
---|---|---|
<entity_type> | Entity type:
|
String |
<entity_ID> | Entity ID. To get the ID, see the entity list. | String |
Warning
Entity ID is not the same as project or portfolio ID.
Additional parameters
Parameter | Description | Data type |
---|---|---|
fields | Additional entity fields to be included into the response. | String |
expand | Additional information to be included into the response:
|
String |
Additional parameters
Parameter | Description | Data type |
---|---|---|
fields | Object with entity settings. | Object |
comment | Comment. | String |
links | Array of objects with settings of links to other entities. | Array of objects |
Fields
object fields
Parameter | Description | Data type |
---|---|---|
summary | Name (required field). | String |
queues | Queue (required for projects if the teamAccess field is not set). |
String |
teamAccess | Access (required for projects if the queues field is not set). |
Logical |
description | Description. | String |
author | Author (user ID). | Number |
lead | Responsible person (user ID). | Number |
teamUsers | Members (array of user IDs). | Array of numbers |
clients | Clients (array of user IDs). | Array of numbers |
followers | Followers (array of user IDs). | Array of numbers |
start | Start date in YYYY-MM-DDThh:mm:ss.sss±hhmm format. |
Date |
end | Deadline in YYYY-MM-DDThh:mm:ss.sss±hhmm format. |
Date |
tags | Tags. | Array of strings |
parentEntity | Parent entity (portfolio) ID. | Number |
entityStatus | Status:
|
String |
links array object fields
Parameter | Description | Data type |
---|---|---|
relationship | Link type. e.g.:
|
String |
entity | Linked entity's ID. | String |
Example: Renaming a project and leaving a comment
- An HTTP PATCH method is used.
- The project is renamed to Test 2.
- A Project renamed record is added to project comments.
- The response will display attachments.
PATCH /v2/entities/project/655f8cc523db213********?expand=attachments HTTP/1.1 Host: https://api.tracker.yandex.net Authorization: OAuth <OAuth_token> X-Org-ID: <organization ID> { "fields": { "summary":"Test 2", }, "comment":"Project renamed" }
Response format
If the request is successful, the API returns a response with code 200 OK
.
The response body contains information about the updated entity in JSON format.
{
"self": "https://https://api.tracker.yandex.net/v2/entities/project/655f328da834c763********",
"id": "655f328da834c763********",
"version": 3,
"shortId": 2,
"entityType": "project",
"createdBy": { "self": "https://https://api.tracker.yandex.net/v2/users/11********", "id": "11********", "display": "Full Name", "cloudUid": "ajevuhegoggf********", "passportUid": 11******** },
"createdAt": "2023-11-23T11:07:57.298+0000",
"updatedAt": "2023-11-23T15:46:26.391+0000",
"attachments": [
{
"self": "https://https://api.tracker.yandex.net/v2/attachments/8",
"id": "8",
"name": "file1.docx",
"content": "https://api.tracker.yandex.net/v2/attachments/8/file1.docx",
"createdBy": { "self": "https://https://api.tracker.yandex.net/v2/users/11********", "id": "11********", "display": "Full Name", "cloudUid": "ajevuhegoggf********", "passportUid": 11******** },
"createdAt": "2023-11-23T15:46:20.617+0000",
"mimetype": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"size": 18585
},
{
"self": "https://https://api.tracker.yandex.net/v2/attachments/9",
"id": "9",
"name": "file2.pdf",
"content": "https://api.tracker.yandex.net/v2/attachments/9/file2.pdf",
"createdBy": { "self": "https://https://api.tracker.yandex.net/v2/users/11********", "id": "11********", "display": "Full Name", "cloudUid": "ajevuhegoggf********", "passportUid": 11******** },
"createdAt": "2023-11-23T15:46:25.932+0000",
"mimetype": "application/pdf",
"size": 175656
}
]
}
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the project. | String |
id | Entity ID. | String |
version | Project version. Each change of the parameters increases the version number. | Number |
shortId | Project or portfolio ID | String |
entityType | Entity type. | String |
createdBy | Block with information about the user who created the entity. | Object |
createdAt | Entity creation date in YYYY-MM-DDThh:mm:ss.sss±hhmm format. |
String |
updatedAt | Date when the entity was last updated, in YYYY-MM-DDThh:mm:ss.sss±hhmm format. |
String |
attachments | Array of objects with information about the attachment. | Array of objects |
createdBy
object fields
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the user who created the entity. | String |
id | User ID. | Number |
display | Displayed user name. | String |
cloudUid | User unique ID in Yandex Cloud Organization. | String |
passportUid | Unique ID of the user account in the Yandex 360 for Business organization and Yandex ID. | String |
If the request is processed incorrectly, the API returns a response with an error code:
- 400
- One or more request parameters have an invalid value.
- 401
- The user isn't authorized. Make sure to perform the actions described in API access.
- 403
- Insufficient rights 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.
- 412
- There was a conflict when editing the object. The error may be due to an invalid update version.
- 428
- Access to the resource is denied. Make sure all required conditions for the request are specified.