YouTrack InCloud 2019.1 Help

Issue Work Items

Resource that provides access to work items.

Resource

/api/workItems

Returned entity

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

Supported methods

IssueWorkItem attributes

Time tracking settings of the project.

This table describes attributes of the IssueWorkItem entity.

  • To receive an attribute in the response from server, specify it explicitly in the request parameter fields.

  • To update an attribute, provide it in the body of a POST request.

Field

Type

Description

author

User

The user to whom the work is attributed in the work item. Can be null.

creator

User

The user who added the work item to the issue. Read-only. Can be null.

text

String

The work item description. Can be null.

textPreview

String

Parsed preview of the description. Read-only.

type

WorkItemType

The work item type. Can be null.

created

Long

The date when the work item was created. Can be null.

updated

Long

The date when the work item was last updated. Can be null.

duration

DurationValue

The duration of the work item.

date

Long

The date and time that is assigned to the work item. Stored as a Unix timestamp in UTC. The time part is set to midnight for the current date.

issue

Issue

Stores attributes of the issue to which the work item is attached. Read-only.

usesMarkdown

Boolean

Stores the format of the comment text. When true, the comment is processed as Markdown formatted text. Otherwise, the comment is processed as YouTrack Wiki formatted.

Read a List of IssueWorkItems

Get all work items matching query. If no query is provided, all work items are returned.

Request syntax

GET /api/workItems?{fields}&{$top}&{$skip}&{query}, &{startDate}, &{endDate}, &{start}, &{end}, &{author}, &{creator}

Request parameters

Parameter

Type

Description

fields

string

A list of IssueWorkItem attributes that should be returned in the response. If no field is specified, only the entityID is returned.

$skip

int

Optional. Lets you set a number of returned entities to skip before returning the first one.

$top

int

Optional. Lets you specify the maximum number of entries that are returned in the response.

query

STRING

Issues search query. Read more about search syntax here: Search-and-Command-Attributes

startDate

DATE

The start date of the interval for work items date.

endDate

DATE

end date of the interval for work items date

start

STRING

start timestamp of the interval for work items date

end

STRING

end timestamp of the interval for work items date

author

STRING

Parameter to filter work items by there author. Could specify few values of database id or login or Hub id or 'me' for current logged in user

creator

STRING

Parameter to filter work items by there creator. Could specify few values of database id or login or Hub id or 'me' for current logged in user

Sample request URI

https://example.myjetbrains.com/youtrack/api/issues/SNBX-1/timeTracking/workItems?$top=2&fields=created,duration(presentation,minutes),author(name),creator(name),date,id

Sample response body

[ { "duration": { "presentation": "5h", "minutes": 300, "$type": "DurationValue" }, "created": 1536278263415, "date": 1536278400000, "creator": { "name": "John Smith", "$type": "User" }, "author": { "name": "John Smith", "$type": "User" }, "id": "115-0", "$type": "IssueWorkItem" }, { "duration": { "presentation": "1h", "minutes": 60, "$type": "DurationValue" }, "created": 1539088817836, "date": 1538956800000, "creator": { "name": "John Doe", "$type": "User" }, "author": { "name": "Jane Doe", "$type": "User" }, "id": "115-2", "$type": "IssueWorkItem" } ]

Add a New IssueWorkItem

Add a new work item to a specific issue.

Request syntax

POST /api/workItems?{fields}

Request parameters

Parameter

Type

Description

fields

string

A list of IssueWorkItem attributes that should be returned in the response. If no field is specified, only the entityID is returned.

Sample request URI

https://example.myjetbrains.com/youtrack/api/issues/2-35/timeTracking/workItems

Sample request body

{ "usesMarkdown":true, "date":1539000000000, "author":{"id":"1-3"}, "duration": {"minutes":120}, "type":{"id":"65-1"} }
Last modified: 12 April 2019