YouTrack Standalone 2020.6 Help

Issue Work Items

This resource lets you work with work items in the specific issue.

Resource

/api/issues/{issueID}/timeTracking/workItems

Returned entity

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

Supported methods

IssueWorkItem attributes

Represents a work item in an issue.

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 the list of all work items of the specific issue.

Request syntax

GET /api/issues/{issueID}/timeTracking/workItems?{fields}&{$top}&{$skip}

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.

Sample

Sample request

https://example.myjetbrains.com/youtrack/api/issues/2-35/timeTracking/workItems?fields=author(id,name),creator(id,name),date,duration(id,minutes,presentation),id,name,text,type(id,name)

Sample response body

[ { "date": 1536278400000, "duration": { "id": "300", "minutes": 300, "presentation": "5h", "$type": "DurationValue" }, "type": { "name": "Testing", "id": "65-1", "$type": "WorkItemType" }, "text": "almost there", "creator": { "name": "John Smith", "id": "1-1", "$type": "User" }, "author": { "name": "John Smith", "id": "1-1", "$type": "User" }, "id": "115-0", "$type": "IssueWorkItem" }, { "date": 1538956800000, "duration": { "id": "60", "minutes": 60, "presentation": "1h", "$type": "DurationValue" }, "type": { "name": "Documentation", "id": "65-2", "$type": "WorkItemType" }, "text": "added a document for internal parameters. check wiki for details", "creator": { "name": "John Doe", "id": "1-2", "$type": "User" }, "author": { "name": "Jane Doe", "id": "1-3", "$type": "User" }, "id": "115-2", "$type": "IssueWorkItem" }, { "date": 1538956800000, "duration": { "id": "120", "minutes": 120, "presentation": "2h", "$type": "DurationValue" }, "type": { "name": "Testing", "id": "65-1", "$type": "WorkItemType" }, "text": null, "creator": { "name": "John Doe", "id": "1-2", "$type": "User" }, "author": { "name": "John Doe", "id": "1-2", "$type": "User" }, "id": "115-5", "$type": "IssueWorkItem" }, { "date": 1538956800000, "duration": { "id": "120", "minutes": 120, "presentation": "2h", "$type": "DurationValue" }, "type": { "name": "Testing", "id": "65-1", "$type": "WorkItemType" }, "text": null, "creator": { "name": "John Doe", "id": "1-2", "$type": "User" }, "author": { "name": "Jane Doe", "id": "1-3", "$type": "User" }, "id": "115-6", "$type": "IssueWorkItem" }, { "date": 1538956800000, "duration": { "id": "120", "minutes": 120, "presentation": "2h", "$type": "DurationValue" }, "type": { "name": "Testing", "id": "65-1", "$type": "WorkItemType" }, "text": null, "creator": { "name": "John Doe", "id": "1-2", "$type": "User" }, "author": { "name": "Jane Doe", "id": "1-3", "$type": "User" }, "id": "115-7", "$type": "IssueWorkItem" } ]

Add a New IssueWorkItem

Add a new work item to the issue.

Request syntax

POST /api/issues/{issueID}/timeTracking/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

Sample request

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

Sample request body

{ "usesMarkdown": true, "text": "I keep on testing *samples*.", "date": 1539000000000, "author": { "id": "1-3" }, "duration": { "minutes": 120 }, "type": { "id": "65-1" } }
Last modified: 30 March 2021