Edit an issue

Use this request to make changes to an issue. The issue is selected by its ID or key.

Request format

To update an issue, use an HTTP PATCH request. A request sent using the PATCH method changes only the parameters that are explicitly specified in the request message body.

PATCH /v2/issues/<issue-id>?
version=<version number>
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth token>
X-Org-Id: <organization ID>

{
    "summary": "new title",
    "parent": {
        "key": "JUNE-5",
        },

    "description": "new text description",    
    "sprint": [
            {
                "id": "5317",
            }
        ],
    "type": {
        "key": "task",
        },
    "priority": {
        "key": "normal",
        },
    "followers": ["<user1 ID>", "<user2 ID>, ..."],
    "queue": {
        "id": "111",
        },

    "favorite": true
}
Resource
<issue-id>
Issue ID or key.
Request parameters
version (optional)
Version of the issue. Changes are made only to the current version of the issue.
Request message body

The request message body passes a JSON object with the new values of the issue parameters. The request only changes the values of the parameters that are explicitly specified in the body.

For objects that contain links, there are several ways to add new information:
  • Specifying a key or ID — the key or ID is passed to the field with the object name. For example, to change the issue type, pass the ID {"type": 2} or the key {"key": "bug"} for the new issue type.
  • Specifying an object with a key or name — the request message body contains the object to update with a field containing the object ID or name:
    {
        "type": { "id": "2" }
    }
    {
        "type": { "name": "Bug" }
    }
To add or remove values in arrays, use objects with the add and remove values:
{
    "followers": { "add": ["<user1 ID>", "<user2 ID>"] }
}
Note. The add command inserts new values into the array. To overwrite the array (remove old values and add new ones), use the set command.
To clear a field, pass the value null. To clear an array, pass an empty array []. To change individual values in the array, pass an object with the target and replacement fields:
{
  "followers": {
    "replace": [
        {"target": "<identifier1>", "replacement": "<identifier2>"},
        {"target": "<identifier3>", "replacement": "<identifier4>"}]
  }
}
Parameter Description Data type
summary

Title of the issue.

String.
parent

A section with information about the parent issue.

Object.

description

Description of the issue.

String.
sprint

A section with information about the sprint.

Array of objects.

type

A section with information about the type of issue.

Object.

priority

A section with information about the priority of the issue.

Object.

followers

A section with information about the observers of the issue.

Object.

queue

A section with information about the issue's queue.

Object.

favorite

Whether the issue is a favorite:

  • true — The user added the issue to Favorites.

  • false — The issue is not in the user's Favorites.

Boolean.

Changing the title of the issue:

  • Uses the HTTP PATCH method.

PATCH /v2/issues/TEST-10322 HTTP/1.1
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth token>
X-Org-Id: <organization ID>
Cache-Control: no-cache

{
    "summary": "test"
}

Changing the parent issue:

  • Uses the HTTP PATCH method.

PATCH /v2/issues/TEST-10322 HTTP/1.1
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth token>
X-Org-Id: <organization ID>
Cache-Control: no-cache

{
  "parent":"TREK-1234"
}

Response format

If the request is successful, the response contains the new description for the edited task.

{
    "self": "https://api.tracker.yandex.net/v2/issues/TREK-9844",
    "id": "593cd211ef7e8a332414f2a7",
    "key": "TREK-9844",
    "version": 7,
    "lastCommentUpdatedAt": "2017-07-18T13:33:44.291+0000",
    "summary": "subtask",
    "parent": {
        "self": "https://api.tracker.yandex.net/v2/issues/JUNE-2",
        "id": "593cd0acef7e8a332414f28e",
        "key": "JUNE-2",
        "display": "Task"
        },
    "aliases": [
            "JUNE-3"
        ],

    "updatedBy": {
        "self": "https://api.tracker.yandex.net/v2/users/1120000000016876",
        "id": "<user ID>",
        "display": "<user's display name>"
        },
    "description": "<#<html><head></head><body><div>test</div><div> </div><div> </div> </body></html>#>",    
    "sprint": [
            {
        "self": "https://api.tracker.yandex.net/v2/sprints/5317",
        "id": "5317",
        "display": "sprint1"
            }
        ],
    "type": {
        "self": "https://api.tracker.yandex.net/v2/issuetypes/2",
        "id": "2",
        "key": "task",
        "display": "Task"
        },
    "priority": {
        "self": "https://api.tracker.yandex.net/v2/priorities/2",
        "id": "2",
        "key": "normal",
        "display": "Normal"
        },

    "createdAt": "2017-06-11T05:16:01.339+0000",
    "followers": [
        {
        "self": "https://api.tracker.yandex.net/v2/users/1120000000016876",
        "id": "<user ID>",
        "display": "<user's display name>"
        }
        ],
    "createdBy": {
        "self": "https://api.tracker.yandex.net/v2/users/1120000000049224",
        "id": "<user ID>",
        "display": "<user's display name>"
        },
    "votes": 0,
    "assignee": {
        "self": "https://api.tracker.yandex.net/v2/users/1120000000049224",
        "id": "<user ID>",
        "display": "<user's display name>"
        },
    "queue": {
        "self": "https://api.tracker.yandex.net/v2/queues/TREK",
        "id": "111",
        "key": "TREK",
        "display": "Trek"
        },
    "updatedAt": "2017-07-18T13:33:44.291+0000",
    "status": {
        "self": "https://api.tracker.yandex.net/v2/statuses/1",
        "id": "1",
        "key": "open",
        "display": "Open"
        },
    "previousStatus": {
        "self": "https://api.tracker.yandex.net/v2/statuses/2",
        "id": "2",
        "key": "resolved",
        "display": "Resolved"
        },
    "favorite": false
}
Response parameters
Parameter Description Data type
self

URL of the API resource that contains information about the issue.

String.
id

The issue ID.

String.
key

The issue key.

String
version

Version of the issue. Each change to the issue parameters increases the version number.

Integer.
lastCommentUpdatedAt

The date and time when the last comment was added.

String.
summary

Title of the issue.

String.
parent

Object with information about the parent issue.

Object.
aliases

Array with information about alternate issue keys.

Array of strings.
updatedBy

Object with information about the last person who modified the issue.

Object.
description

Description of the issue.

String.
sprint

An array of objects with information about the sprint.

Array of objects.
type

Object with information about the type of issue.

Object.
priority

Object with information about the priority.

Object.
createdAt

Date and time the issue was created.

String.
followers

An array of objects with information about followers of the issue.

Array of objects.
createdBy

Object with information about the person who created the issue.

Object.
votes

Number of votes for the issue.

Integer.
assignee

Object with information about the person assigned to the issue.

Object.
queue

Object with information about the queue that the issue belongs to.

Object.
updatedAt

Date and time when the issue was last updated.

String.
status

Object with information about the status of the issue.

Object.
previousStatus

Object with information about the previous status of the issue.

Object.
favorite

Whether the issue is a favorite:

  • true — The user added the issue to Favorites.

  • false — The issue is not in the user's Favorites.

Boolean.
Fields for the parent object
self

Reference to the issue.

String.

id

The issue ID.

String.

key

The issue key.

String.

display

The display name of the issue.

String.

Fields for the updatedBy object
self

Reference to the Tracker user.

String.

id

User ID.

String.

display

Display name of the user.

String.

Fields for objects in the sprint array
self

Reference to the sprint.

String.

id

ID of the sprint.

String.

display

Display name of the sprint.

String.

Fields for the type object
self

Reference to the type of issue.

String.

id

ID of the issue type.

String.

key

Key of the issue type.

String.

display

Display name of the issue type.

String.

Fields for the priority object
self

Reference to the priority type.

String.

id

Priority ID.

String.

key

Priority key.

String.

display

Display name of the priority.

String.

Fields for objects in the followers array
self

Reference to the Tracker user.

String.

id

User ID.

String.

display

Display name of the user.

String.

Fields for the createdBy object
self

Reference to the Tracker user.

String.

id

User ID.

String.

display

Display name of the user.

String.

Fields for the assignee object
self

Reference to the Tracker user.

String.

id

User ID.

String.

display

Display name of the user.

String.

Fields for the queue object
self

Reference to the queue.

String.

id

The queue ID.

String.

key

The queue key.

String.

display

Display name of the queue.

String.

Fields for the status object
self

A reference to the status.

String.

id

The status ID.

String.

key

The status key.

String.

display

Display name of the status.

String.

Fields for the previousStatus object
self

A reference to the status.

String.

id

The status ID.

String.

key

The status key.

String.

display

Display name of the status.

String.

Possible response codes

200
The request was successful.
401
The user is not authorized. Check whether all the steps described in API access were completed.
403
You do not have sufficient rights to perform this action. Double-check permissions in the Tracker interface. You need the same permissions to perform the action via the API as in the interface.
404
The requested object was not found. You might have entered an incorrect object ID or key value.
409
There was an editing conflict. This error might occur if the wrong version of changes was specified.