Editing an issue
Use this request to make changes to issues.
PATCH
https://api.tracker.yandex.net/v3/issues/<issue_ID>
You can only change the issue status with the Status transition request.
Request format
Before making a request, get permission to access the API.
To edit an issue, use an HTTP PATCH
request. In the request body, specify the parameters in JSON format.
PATCH /v3/issues/<issue_ID>
Host: api.tracker.yandex.net
Authorization: OAuth <OAuth_token>
X-Org-ID or X-Cloud-Org-ID: <organization_ID>
{
Request body in JSON format
}
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 |
---|---|---|
<issue_key_or_ID> | ID or key of the current issue. | String |
Request parameters
Additional parameters
Parameter | Description | Data type |
---|---|---|
version | Issue version. Changes are only made to the current version of the issue. | Number |
Request body parameters
The request body includes a JSON object with the IDs of updated fields and their values. To edit issue fields, you can use the set
, add
, remove
, and other operators.
For more information, see Request body format.
Additional parameters
The table lists frequently used issue parameters. For a full list of supported parameters, see https://tracker.yandex.com/admin/fields.
Parameter | Description | Data type |
---|---|---|
summary | Issue name. | String |
parent | Parent issue. | Object or string |
description | Issue description. | String |
markupType | Type of text markup. If you use the YFM markup in issue descriptions, specify the md value. |
String |
sprint | Block with information about sprints. | Array of objects or strings |
type | Issue type | Can be set as an object, a string (if the issue type key is provided), or a number (if the issue type ID is provided). |
priority | Issue priority | Can be set as an object, a string (if the priority key is provided), or a number (if the priority ID is provided). |
followers | IDs or usernames of issue followers | Array of objects or strings |
project | Block with information about the issue projects | Map object |
attachmentIds | IDs of temporary files that will be added as attachments. | Array of strings |
descriptionAttachmentIds | IDs of temporary files that will be added to the issue description. | Array of strings |
tags | Block with tag information. | Array of strings |
parent
object fields
Parameter | Description | Data type |
---|---|---|
id | Parent issue ID | String |
key | Parent issue key | String |
sprint
object fields
Parameter | Description | Data type |
---|---|---|
id | Sprint ID. You can get the sprint information using the request. | Number |
type
object fields
Parameter | Description | Data type |
---|---|---|
id | Issue type ID | String |
key | Key of the issue type. | String |
priority
object fields
Parameter | Description | Data type |
---|---|---|
id | Priority ID | String |
key | Priority key. | String |
followers
object fields
Parameter | Description | Data type |
---|---|---|
id | Employee ID | String |
project
object fields
Parameter | Description | Data type |
---|---|---|
primary | ID of the main issue project (the shortId project field) |
Number |
secondary | IDs of additional issue projects (the shortId project field) |
Array of numbers |
If the request address specifies API v2
, the project
parameter can contain only the ID of the main project.
For example: "project": 1234
Example 1: Changing the name, description, type, and priority of an issue.
- An HTTP PATCH method is used.
- We are editing the TEST-1 issue.
- New issue type: Error.
- New issue priority: Low.
PATCH /v3/issues/TEST-1 Host: api.tracker.yandex.net Authorization: OAuth <OAuth_token> X-Org-ID or X-Cloud-Org-ID: <organization_ID> { "summary": "<new_issue_name>", "description": "<new_issue_description>", "type": { "id": "1", "key": "bug" }, "priority": { "id": "2", "key": "minor" } }
Example 2: Changing the parent issue, add it to sprints, and add followers.
- An HTTP PATCH method is used.
- We are editing the TEST-1 issue.
- New parent issue: TEST-2.
- The issue is added to sprints with ID 3 and ID 2. The sprints must be on different boards.
- Followers added:
userlogin-1
anduserlogin-2
.
PATCH /v3/issues/TEST-1 Host: api.tracker.yandex.net Authorization: OAuth <OAuth_token> X-Org-ID or X-Cloud-Org-ID: <organization_ID> { "parent": { "key": "TEST-2"}, "sprint": [{"id": "3"}, {"id": "2"}], "followers": { "add": ["userlogin-1", "userlogin-2"] } }
Example 3: Adding one tag to an issue and removing another.
- An HTTP PATCH method is used.
- We are editing the TEST-1 issue.
- Add tag:
tag1
.- Remove tag:
tag2
.
PATCH /v3/issues/TEST-1 Host: api.tracker.yandex.net Authorization: OAuth <OAuth token> X-Org-ID or X-Cloud-Org-ID: <organization_ID> { "tags": { "add": ["tag1"], "remove": ["tag2"] } }
Example 4: Changing the issue's main project and adding an additional project
- An HTTP PATCH method is used.
- The project with ID
1234
is specified as the main one.- The project with ID
5678
is added to the list of additional projects.
PATCH /v3/issues/TEST-1 Host: api.tracker.yandex.net Authorization: OAuth <OAuth_token> X-Org-ID or X-Cloud-Org-ID: <organization_ID> { "project": { "primary": 1234, "secondary": { "add": [5678] } } }
Response format
If the request is successful, the API returns a response with code 200 OK
.
The response body contains information about the edited issue in JSON format.
[
{
"self": "https://api.tracker.yandex.net/v3/issues/TREK-9844",
"id": "593cd211ef7e8a33********",
"key": "TREK-9844",
"version": 7,
"lastCommentUpdatedAt": "2017-07-18T13:33:44.291+0000",
"summary": "subtask",
"parent": {
"self": "https://api.tracker.yandex.net/v3/issues/JUNE-2",
"id": "593cd0acef7e8a33********",
"key": "JUNE-2",
"display": "Task"
},
"aliases": [
"JUNE-3"
],
"updatedBy": {
"self": "https://api.tracker.yandex.net/v3/users/11********",
"id": "11********",
"display": "Ivan Ivanov"
},
"description": "<#<html><head></head><body><div>test</div><div> </div><div> </div> </body></html>#>",
"sprint": [
{
"self": "https://api.tracker.yandex.net/v3/sprints/53**",
"id": "53**",
"display": "sprint1"
}
],
"type": {
"self": "https://api.tracker.yandex.net/v3/issuetypes/2",
"id": "2",
"key": "task",
"display": "Issue"
},
"priority": {
"self": "https://api.tracker.yandex.net/v3/priorities/2",
"id": "2",
"key": "normal",
"display": "Normal"
},
"createdAt": "2017-06-11T05:16:01.339+0000",
"followers": [
{
"self": "https://api.tracker.yandex.net/v3/users/11********",
"id": "11********",
"display": "Ivan Ivanov"
}
],
"createdBy": {
"self": "https://api.tracker.yandex.net/v3/users/11********",
"id": "11********",
"display": "Ivan Ivanov"
},
"votes": 0,
"assignee": {
"self": "https://api.tracker.yandex.net/v3/users/11********",
"id": "11********",
"display": "Ivan Ivanov"
},
"project": {
"primary": {
"self": "https://api.tracker.yandex.net/v3/projects/1",
"id": "1",
"display": "Startrek project"
},
"secondary": []
},
"queue": {
"self": "https://api.tracker.yandex.net/v3/queues/TREK",
"id": "111",
"key": "TREK",
"display": "Startrek"
},
"updatedAt": "2017-07-18T13:33:44.291+0000",
"status": {
"self": "https://api.tracker.yandex.net/v3/statuses/1",
"id": "1",
"key": "open",
"display": "Open"
},
"previousStatus": {
"self": "https://api.tracker.yandex.net/v3/statuses/2",
"id": "2",
"key": "resolved",
"display": "Resolved"
},
"favorite": false
},
{...}
]
Response parameters
The table lists frequently used issue parameters. For a full list of supported parameters, see https://tracker.yandex.com/admin/fields.
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the issue | String |
id | Issue ID | String |
key | Issue key | String |
version | Issue version. Changing issue parameters increases the issue's version number. Issue edits will be disabled if the version number reaches the threshold value of 10100 (for robots) or 11100 (for users) |
Number |
lastCommentUpdatedAt | Date and time when the last comment was added | String |
summary | Issue name | String |
parent | Object with information about the parent issue | Map object |
aliases | Array with information about alternative issue keys | Array of strings |
updatedBy | Object with information about the employee who edited the issue last | Map object |
description | Problem description | String |
sprint | Array of objects with information about the sprint | Array of objects |
type | Object with information about the issue type | Map object |
priority | Object with information about the priority | Map object |
createdAt | Issue creation date and time | String |
followers | Array of objects with information about issue followers | Array of objects |
createdBy | Object with information about the user who created the issue | Map object |
votes | Number of votes for the issue | Number |
assignee | Object with information about the issue's assignee | Map object |
project | Object with information about the issue project | Map object |
queue | Object with information about the issue queue | Map object |
updatedAt | Date and time when the issue was last updated | String |
status | Object with information about the issue status | Map object |
previousStatus | Object with information about the previous status of the issue | Map object |
favorite | Favorite issue flag:
|
Boolean |
tags | Issue tags | Array of strings |
parent
object fields
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the issue. | String |
id | Issue ID. | String |
key | Issue key. | String |
display | Issue name displayed. | String |
updatedBy
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 |
Sprint
array object fields
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the sprint. | String |
id | Sprint ID. | String |
display | Sprint name displayed. | String |
type
object fields
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the issue type. | String |
id | Issue type ID | String |
key | Issue type key. | String |
display | Issue type name displayed. | String |
priority
object fields
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the priority. | String |
id | Priority ID | String |
key | Priority key. | String |
display | Priority name displayed. | String |
followers
array 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 |
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 |
assignee
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 |
project
object fields
Parameter | Description | Data type |
---|---|---|
primary | Main issue project | Object |
secondary | List of additional issue projects | Array of objects |
If the request address specifies API v2
, the project
object contains information only about the main project.
Fields of the object that contains project data
The primary
and secondary
parameters contain objects with the following fields:
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the project | String |
id | Project ID | String |
display | Project name displayed | String |
queue
object fields
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the queue. | String |
id | Queue ID. | String |
key | Queue key. | String |
display | Queue name displayed. | String |
status
object fields
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the status. | String |
id | Status ID. | String |
key | Status key. | String |
display | Status name displayed. | String |
previousStatus
object fields
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the status. | String |
id | Status ID. | String |
key | Status key. | String |
display | Status name displayed. | String |
If the request is processed incorrectly, the API returns a response with an error code:
- 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.
- 409
- There was a conflict when 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.