Updating an entity
Use this request to update information about an entity: a goal, project, or project portfolio.
PATCH
https://api.tracker.yandex.net/v3/entities/<entity_type>/<entity_ID>
Query format
Before making a request, get permission to access the API.
To update an entity, use an HTTP PATCH
request. In the request body, specify the parameters in JSON format.
PATCH /v3/entities/<entity_type>/<entity_ID>
Host: api.tracker.yandex.net
Authorization: OAuth <OAuth_token>
X-Org-ID or X-Cloud-Org-ID: <organization_ID>
{
"fields":
{
"summary": "<new_name>",
"teamAccess": true,
"parentEntity": {
"primary": "<parent_entity_ID>"
}
},
"comment":"<comment>",
"links":
[
{
"relationship": "<link>",
"entity": "<linked_entity_ID>"
}
]
}
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
orX-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 Administration → Organizations and copy the value from the ID field.
-
Resource
Parameter | Description | Data type |
---|---|---|
<entity_type> | Entity type:
|
String |
<entity_ID> | Entity ID. To get the ID, see the entity list. You can use the id or shortId parameter as the ID. |
String |
Request parameters
Additional parameters
Parameter | Description | Data type |
---|---|---|
fields | Additional entity fields to include in the response | String |
expand | Additional information to include in the response:
|
String |
Request body parameters
Additional parameters
Parameter | Description | Data type |
---|---|---|
fields | Object with entity settings For more information, see Additional entity parameters. | Map item |
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 the project if the |
String |
teamAccess |
Access (required for the project if the |
Logical |
description |
Description |
String |
markupType |
Text markup type. If you use YFM markup in a comment or entity description, specify the |
String |
author |
Author (user ID) |
String |
lead |
Lead (user ID) |
String |
teamUsers |
Participants (array of user IDs) |
String array |
clients |
Customers (array of user IDs) |
String array |
followers |
Followers (array of user IDs) |
String array |
start |
Start date in |
Date |
end |
Deadline in |
Date |
tags |
Tags |
String array |
Parent entity data. For a project or portfolio: "Included in the portfolio" field |
Object |
|
entityStatus |
Status. Acceptable status valuesFor projects or portfolios:
For goals:
|
String |
links
array object fields
Parameter |
Description |
Data type |
relationship |
Link type. For projects and portfolios:
For goals:
|
String |
entity |
ID of the linked entity. |
String |
parentEntity object fields
Parameter | Description | Data type |
---|---|---|
primary | ID of the main portfolio (for projects and portfolios) or parent goal (for goals) | String |
secondary | For projects and portfolios: IDs of additional portfolios Goals don't support the secondary parameter. |
Array of strings |
If the API v2
is specified in the request address, the parentEntity
parameter can contain only the ID of the main parent entity.
For example: "parentEntity": "66e2fa183*****"
Example 1: 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 /v3/entities/project/655f8cc52*****?expand=attachments HTTP/1.1 Host: api.tracker.yandex.net Authorization: OAuth <OAuth_token> X-Org-ID or X-Cloud-Org-ID: <organization_ID> { "fields": { "summary":"Test 2" }, "comment":"Project renamed" }
Example 2: Changing the project's main portfolio and adding an additional portfolio
- An HTTP PATCH method is used.
- The portfolio with ID
66e2fa183*****
is specified as the main one.- The portfolio with ID
670e702fd*****
is added to the list of additional portfolios.- The response will display parent entities.
PATCH /v3/entities/project/655f8cc52*****?fields=parentEntity HTTP/1.1 Host: api.tracker.yandex.net Authorization: OAuth <OAuth_token> X-Org-ID or X-Cloud-Org-ID: <organization_ID> { "fields": { "parentEntity": { "primary": "66e2fa183*****", "secondary": { "add": ["670e702fd*****"] } } } }
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://api.tracker.yandex.net/v3/entities/project/655f328da834c763********",
"id": "655f328da834c763********",
"version": 3,
"shortId": 2,
"entityType": "project",
"createdBy": { "self": "https://api.tracker.yandex.net/v3/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://api.tracker.yandex.net/v3/attachments/8",
"id": "8",
"name": "file1.docx",
"content": "api.tracker.yandex.net/v3/attachments/8/file1.docx",
"createdBy": { "self": "https://api.tracker.yandex.net/v3/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://api.tracker.yandex.net/v3/attachments/9",
"id": "9",
"name": "file2.pdf",
"content": "api.tracker.yandex.net/v3/attachments/9/file2.pdf",
"createdBy": { "self": "https://api.tracker.yandex.net/v3/users/11********", "id": "11********", "display": "Full name", "cloudUid": "ajevuhegoggf********", "passportUid": 11******** },
"createdAt": "2023-11-23T15:46:25.932+0000",
"mimetype": "application/pdf",
"size": 175656
}
],
"fields":
{
"teamAccess": null
}
}
Response parameters
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the project | String |
id | Entity ID. | String |
version | Entity version. Changing entity parameters increases the entity's version number. Entity edits will be disabled if the version number reaches the threshold value of 10100 (for robots) or 11100 (for users). |
Number |
shortId | Goal, project, or portfolio ID in Tracker | String |
entityType | Entity type | String |
createdBy | Block with information about the entity creator | 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 |
fields | Block with additional entity fields. | Map item |
createdBy
object fields
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 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 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.
- 412
- A conflict occurred while editing the object. The error may be due to an invalid update version.
- 423
- Object edits disabled. The
version
parameter value limit (the maximum number of object updates) might have been exceeded. The maximum version value is10100
for robots and11100
for users.
- 428
- Access to the resource is denied. Make sure all required conditions for the request are specified.