Create an issue
Use this request to create issues.
Request format
Before making the request, get permission to access the API.
To create an issue, use an HTTP POST
request. Request parameters are passed in the request body in JSON format:
POST /v2/issues/
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth token>
X-Org-ID: <organization ID>
{
"summary": "issue name",
"queue": {
"id": "111",
"key": "test"
}
}
-
Host
API host address:
https://api.tracker.yandex.net
-
Authorization
OAuth token in
OAuth <token value>
format. For example:OAuth 0c4181a7c2cf4521964a72ff57a34a07
-
X-Org-ID
Organization ID.
The request body contains the information required to create a new issue:
Required parameters
Parameter | Description | Data type |
---|---|---|
summary | Issue name. | String |
queue | Queue to create the issue in. | Can be set as an object, a string (if the queue key is passed), or a number (if the queue ID is passed). |
Additional parameters
Parameter | Description | Data type |
---|---|---|
parent | Parent issue. | Object or string. |
description | Issue description. | 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 passed), or a number (if the issue type ID is passed). |
priority | Issue priority. | Can be set as an object, a string (if the priority key is passed), or a number (if the priority ID is passed). |
followers | IDs or usernames of issue followers. | Array of objects or strings. |
assignee | ID or username of the issue assignee. | Array of objects or strings. |
unique | Field with a unique value that disables creation of duplicate issues. If you try to create an issue with the same value of this parameter again, no duplicate will be created and the response will contain an error with code 409. | String |
attachmentIds | List of attachment IDs. | Array of strings |
Object fields queue
Parameter | Description | Data type |
---|---|---|
id | Queue ID. | String |
key | Queue key. | String |
Object fields parent
Parameter | Description | Data type |
---|---|---|
id | ID of the parent issue. | String |
key | Key of the parent issue. | String |
Object fields type
Parameter | Description | Data type |
---|---|---|
id | ID of the issue type. | String |
key | Key of the issue type. | String |
Object fields priority
Parameter | Description | Data type |
---|---|---|
id | Priority ID. | String |
key | Priority key. | String |
Object fields followers
Parameter | Description | Data type |
---|---|---|
id | Employee ID. | String |
Object fields assignee
Parameter | Description | Data type |
---|---|---|
id | Employee ID. | String |
Example: Create an issue
- An HTTP POST method is used.
- We're creating an issue named
Test Issuein the queue with the keyTREK.- The new issue is a sub-issue of
JUNE-2.- Type of the new issue:
Bug.- Assignee: <user_login>
POST /v2/issues/ HTTP/1.1 Host: https://api.tracker.yandex.net Authorization: OAuth <OAuth token> X-Org-ID: <organization ID> { "queue": "TREK", "summary": "Test Issue", "parent":"JUNE-2", "type": "bug", "assignee": "<user_login>", "attachmentIds": [55, 56] }
Response format
If the request is successful, the API returns a response with code 201 Created
.
The request body contains information about the created issue in JSON format.
[
{
"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": "<employee ID>",
"display": "<employee name displayed>"
},
"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": "Issue"
},
"priority": {
"self": "https://api.tracker.yandex.net/v2/priorities/2",
"id": "2",
"key": "normal",
"display": "Medium"
},
"createdAt": "2017-06-11T05:16:01.339+0000",
"followers": [
{
"self": "https://api.tracker.yandex.net/v2/users/1120000000016876",
"id": "<employee ID>",
"display": "<employee name displayed>"
}
],
"createdBy": {
"self": "https://api.tracker.yandex.net/v2/users/1120000000049224",
"id": "<employee ID>",
"display": "<employee name displayed>"
},
"votes": 0,
"assignee": {
"self": "https://api.tracker.yandex.net/v2/users/1120000000049224",
"id": "<employee ID>",
"display": "<employee name displayed>"
},
"queue": {
"self": "https://api.tracker.yandex.net/v2/queues/TREK",
"id": "111",
"key": "TREK",
"display": "Startrack"
},
"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
},
{...}
]
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. Each change to the issue parameters increases its version number. | Number |
lastCommentUpdatedAt | Date and time when the last comment was added. | String |
summary | Issue name. | String |
parent | Object with information about the parent issue. | Object |
aliases | Array with information about alternative issue keys. | Array of strings |
updatedBy | Object with information about the employee who edited the issue last. | Object |
description | Issue description. | String |
sprint | Array of objects with information about the sprint. | Array of objects |
type | Object with information about the issue type. | Object |
priority | Object with information about the priority. | 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. | Object |
votes | Number of votes for the issue. | Number |
assignee | Object with information about the issue's assignee. | Object |
queue | Object with information about the issue queue. | Object |
updatedAt | Date and time when the issue was last updated. | String |
status | Object with information about the issue status. | Object |
previousStatus | Object with information about the previous status of the issue. | Object |
favorite | Flag indicating a favorite issue:
|
Boolean |
Object fields parent
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 |
Object fields updatedBy
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the user. | String |
id | User ID. | String |
display | User's name displayed. | String |
Array object fields sprint
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 |
Object fields type
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the issue type. | String |
id | ID of the issue type. | String |
key | Key of the issue type. | String |
display | Issue type name displayed. | String |
Object fields priority
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 |
Array object fields followers
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the user. | String |
id | User ID. | String |
display | User's name displayed. | String |
Object fields createdBy
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the user. | String |
id | User ID. | String |
display | User's name displayed. | String |
Object fields assignee
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the user. | String |
id | User ID. | String |
display | User's name displayed. | String |
Object fields queue
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 |
Object fields status
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 |
Object fields previousStatus
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 |
- 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.