YouTrack Standalone 2018.3 Help

Issues

This section describes resources and methods that let you operate with the list of issues and single issues.

Root resource

/api/issues

Returned entity

Issue. For description of the entity attributes, see the Supported Fields section.

Supported sub-resources

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 true, the text is processed as Markdown formatted. Otherwise, as a wiki-formatted text.

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 true, the issue is a draft and not reported yet.

draftOwner

User?

Stores data about a user account, that owns the draft of this issue. If the issue is already reported, this attribute is null.

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.

Issues List

Work with a list of issues.

Resource

api/issues

Supported methods

Get a List of Issues

Get a list of available issues.

Request syntax

GET /api/issues?{fields}&{query}&{$skip}&{$top}

Request parameters

Parameter

Type

Description

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

A search query to filter the list of returned issues by. You can specify multiple queries. Results for these search filters are returned in subsequent blocks, a list of issues per each filter. For details about YouTrack search query syntax, see Search Query Grammar

$skip

int

When provided, this number of issues that match provided search query is skipped, and the rest of the list is returned in the response.

$top

int

When provided, only first N issues that match provided search query are returned in the response. The subsequent issues are ignored.

Sample request

curl -X GET \ 'https://example.myjetbrains.com/youtrack/api/issues?query=in%3A%20Bonanza%20%23Unresolved&fields=project%28id,name%29,id,numberInProject,summary&$skip=1&$top=2' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer perm:cm9vdA==.cmVzdCBhcGk=.sTOicYYk8TGLJ1Zk1K2W5S4hLzafZx' \ -H 'Content-Type: application/json'

Sample response body

[ { "project": { "name": "Bonanza", "id": "77-3" }, "summary": "Generation P", "numberInProject": 23, "id": "82-88" }, { "project": { "name": "Bonanza", "id": "77-3" }, "summary": "Enable Jabber Notifications in Slack", "numberInProject": 20, "id": "82-83" } ]

Create a New Issue

Create a new issue.

Request syntax

POST /api/issues[?fields=<fields>&<draftId>]

Request parameters

Parameter

Type

Description

fields

string

A list of issue fields that should be returned in the response. If no fields specified, only issue ID is returned.

draftID

string

Optional ID of an existing issue draft. When specified, a new issue is created based on the draft with the specified ID, and the draft itself is removed.

Request body parameters

To create an issue, you must provide two mandatory issue fields in the request body: issue project and issue summary. Depending on the project settings (enabled workflows, for instance), you might be required to provide values for other fields. However, in general, other issue fields are optional. For the complete list of supported issue fields, see the Supported Fields section.

Parameter

Type

Description

project

Project

A project to which the issue belongs.

summary

String

Issue summary.

Sample request

curl -X POST \ 'https://example.myjetbrains.com/youtrack/api/issues?fields=reporter%28login,name%29,idReadable,id,project%28id,name,leader%28login,name%29%29,summary,description' \ -H 'Authorization: Bearer perm:cm9vdA==.cmVzdCBhcGk=.sTOicYYk8TGLJ1Zk1K2W5S4hLzafZx' \ -H 'Accept: application/json' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{ "project":{"id":"0-0"}, "summary":"REST API lets you create issues!", "description":"Let'\''s create a new issue using YouTrack'\''s REST API." }'

Sample response body

{ "description": "Let's create new issue using REST API", "summary": "Issue from REST API", "reporter": { "login": "john.doe", "name": "John Doe" }, "idReadable": "SP-33", "project": { "leader": { "login": "root", "name": "John Smith" }, "name": "Sample Project", "id": "0-0", }, "id": "2-32" }
Last modified: 12 October 2018