Create an issue
Use this request to create an issue.
Request format
To create an issue, use an HTTP POST
request. Request parameters are passed in the message body in JSON format:
POST /v2/issues/
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth token>
X-Org-Id: <organization ID>
{
"summary": "issue title",
"queue": {
"id": "111",
},
"parent": {
"key": "JUNE-5",
},
"description": "text description",
"sprint": [
{
"id": "5317",
}
],
"type": {
"key": "task",
},
"priority": {
"key": "normal",
},
"followers": ["<user1 ID>", "<user2 ID>"],
"unique": "123qwe"
}
The request message body contains the information required to create a new task:
Parameter | Description | Data type |
---|---|---|
summary | Title of the issue. Required field. | String. |
queue | The key of the queue to create the issue in. | String. |
parent | An object that contains the ID or key of the parent issue. | Object. |
description | Description of the issue. | String. |
sprint | An array of objects with information about the sprints that the issue belongs to. | JSON array. |
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. |
unique | Field with a unique value to prevent the creation of duplicate issues. If you try to create another issue with the same value for this parameter, the duplicate won't created, and the response will contain the error code 409. | String. |
Parameter | Description | Data type |
---|---|---|
summary | Title of the issue. Required field. | String. |
queue | The key of the queue to create the issue in. | String. |
parent | An object that contains the ID or key of the parent issue. | Object. |
description | Description of the issue. | String. |
sprint | An array of objects with information about the sprints that the issue belongs to. | JSON array. |
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. |
unique | Field with a unique value to prevent the creation of duplicate issues. If you try to create another issue with the same value for this parameter, the duplicate won't created, and the response will contain the error code 409. | String. |
Changing the title of the issue:
Uses the HTTP POST method.
Creates an issue with the title “Test Issue” in the queue “TREK”.
The new issue is a sub-issue of “JUNE-2”.
Type of issue to create — “Bug”.
POST /v2/issues/ HTTP/1.1
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth token>
X-Org-Id: <organization ID>
Cache-Control: no-cache
{
"queue": "TREK",
"summary": "Test Issue",
"parent":"JUNE-2",
"type": "bug"
}'
Response format
If the request is successful, the API returns a response with the code 201. The response body contains information about the created issue in JSON format.
{
"self": "https://api.tracker.yandex.net/ v2/issues/TREK-9944",
"id": "593cd211ef7e8a332414f2a7",
"key": "TREK-9944",
"version": 7,
"lastCommentUpdatedAt": "2017-07-18T13: 33:44.291+0000",
"summary": "Test Issue",
"parent": {
"self": "https://api.tracker.yandex.net/v2/issues/JUNE-2",
"id": "593cd0acef7e8a332414f28e",
"key": "JUNE-2",
"display": "Task"
},
"aliases": [
"JUNE-3"
],
"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": "Average"
},
"createdAt": "2017-06-11T05:16: 01.339+0000",
"followers": [
{
"self": "https://api.tracker.yandex.net/ v2/users/1120000000016876",
"id": "<user id="">",
"display": "<user display name>"
}
],
"createdBy": {
"self": "https://api.tracker.yandex.net/ v2/users/1120000000049224",
"id": "<user id="">",
"display": "<user display name>"
},
"votes": 0,
"assignee": {
"self": "https://api.tracker.yandex.net/ v2/users/1120000000049224",
"id": "<user id="">",
"display": "<user display name>"
},
"queue": {
"self": "https://api.tracker.yandex.net/ v2/Queens/TREK",
"id": "111",
"key": "TREK",
"display": "trek"
},
"status": {
"self": "https://api.tracker.yandex.net/v2 / statuses/1",
"id": "1",
"key": "open",
"display": "Open"
},
"favorite": false
}
true
— The user added the issue to Favorites.false
— The issue is not in the user's Favorites.true
— The user added the issue to Favorites.false
— The issue is not in the user's Favorites.
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: | 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. |
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: | 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
- 201
- A new object was created as the result of the request.
- 404
- The requested object was not found. You might have entered an incorrect object ID or key value.
- 409
-
There was a conflict when creating an issue: an issue with the same value of the
unique
parameter already exists.