Operations with an Issue
This page describes operations with a single existing issue.
To create a new issue, you need to send a POST
request to the root resource /api/issues
. For details, see the description of the resource.
Work with a single issue with the specified issueID
.
Resource | |
Returned entity | Issue. See the Supported fields section for details about entity attributes. |
Supported methods |
Supported Fields
The following table describes all attributes of the Issue
entity.
Field | Type | Description |
---|---|---|
project | Project | A project to which the issue belongs. |
numberInProject | Long | Read-only. Sequential number of the issue in the project. |
created | Long | Read-only. Issue creation timestamp. |
updated | Long | Read-only. Issue last update timestamp. |
resolved | Long? | Read-only. Issue resolve timestamp or null, if issue is not resolved yet. |
reporter | User | Read-only. A user that reported the issue. |
updater | User | Read-only. A user who updated the issue last. |
summary | String | Issue summary. |
description | String? | Issue description. |
wikifiedDescription | String? | Read-only. An HTML text that is already processed with a wiki/markdown. |
usesMarkdown | Boolean | Indicates which text processor should be used for description. When |
fields | Iterable<IssueCustomField> | Collection of issue fields. For issue fields parameters, see Custom Field Settings and Custom Field Settings: Value Bundles |
isDraft | Boolean | Read-only. When |
draftOwner | User? | Stores data about a user account, that owns the draft of this issue. If the issue is already reported, this attribute is |
draftComment | DraftIssueComment? | A draft of a comment for the current user. |
visibility | Visibility | Visibility settings of an issue. More details. |
parent | Issue? | Read-only. A link to the parent issue of the current one. |
subtasks | Iterable<Issue> | Read-only. A collection of links of the subtask type of the current issue. |
links | Iterable<IssueLink> | A collection of issues linked to the current one. |
externalIssue | ExternalIssue? | Read-only. If the issue is imported from another tracker, this field returns parameters of the original issue. |
votes | Int | Read-only. Number of votes for the current issue. |
voters | IssueVoters | A collection of users who voted for the issue. |
watchers | IssueWatchers | Collection of users who watch the issue. |
tags | Iterable<IssueTag> | A collection of tags added to the issue. |
comments | Iterable<IssueComment> | A collection of issue comments. Read more about issue comments. |
attachments | Iterable<IssueAttachment> | A collection of attachments in the issue. |
Get an Issue
Get an existing issue with the specific ID.
Request |
GET /api/issues/{issueID}?[fields]&[query] |
Request parameters:
Parameter | Type | Description |
---|---|---|
issueID | string | A unique ID of an issue to get. You can provide it either as an issue entity id (for example, 42-44) or an issue id in project (for example, TST-33). |
fields | string | A list of issue fields that should be returned in the response. If no fields specified, only issue ID is returned. |
query | string | By passing the |
Sample request:
curl -X GET \
'https://example.myjetbrains.com/youtrack/api/issues/2-32?fields=summary,description,updated,created,reporter%28login,name,id%29' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json'
Sample response body:
{
"description": "Let's create new issue from REST API",
"summary": "Issue from REST #1",
"reporter": {
"login": "john.doe",
"name": "John Doe",
"id": "1-2"
},
"created": 1534186348819,
"updated": 1534186348819
}
Update an Issue
Update an issue with the specific ID.
Request syntax: |
POST /api/issues/<issueID>?[fields] |
Request parameters:
Parameter | Type | Description |
---|---|---|
issueID | string | A unique ID of an issue to get. You can provide it either as an issue entity id (for example, 42-44) or an issue id in project (for example, TST-33). |
fields | string | A list of issue fields that should be returned in the response. If no fields specified, only issue ID is returned. |
Sample request:
curl -X POST \
'https://example.myjetbrains.com/youtrack/api/issues/2-31?fields=id,reporter%28login,name,id%29,deleted,updater%28login,name,id%29,updated,visibility%28permittedGroups%28name,id%29,permittedUsers%28id,name,login%29%29,summary,description' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"summary": "Another issue created using REST API",
"description": "Please provide here steps to reproduce the problem.",
"visibility": {
"permittedGroups":[{"id":"3-2"}],
"$type": "jetbrains.charisma.persistent.visibility.LimitedVisibility"
}
}'
Sample response body:
{
"description": "Please provide here steps to reproduce the problem.",
"summary": "Another issue created using REST API",
"reporter": {
"login": "john.doe",
"name": "John Doe",
"id": "1-2"
},
"visibility": {
"permittedUsers": [],
"permittedGroups": [
{
"name": "Sample Project Team",
"id": "3-2"
}
],
"$type": "jetbrains.charisma.persistent.visibility.LimitedVisibility"
},
"updater": {
"login": "john.doe",
"name": "John Doe",
"id": "1-2"
},
"updated": 1535649875679,
"id": "2-31"
}
Delete an issue
Delete an issue with the specific ID.
Request syntax: |
DELETE /api/issues/<issueID> |
Sample request:
curl -X DELETE \
https://example.myjetbrains.com/youtrack/api/issues/2-5 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json'
Sample response body:
For a successful DELETE
request, the server sends back a response with the 200 OK
status code and an empty body.