Developer Portal for YouTrack and Hub Help

Operations with Specific IssueWorkItem

Resource that provides access to work items.

Resource

/api/workItems/{itemID}

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.

Related Resources

Below you can find the list of resources that let you work with this entity.

Extends BaseWorkItem

Attributes

This table describes attributes of the IssueWorkItem entity.

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

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

Field

Type

Description

id

String

The ID of the issue work item. Read-only.

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 timestamp in milliseconds indicating the moment when the work item was created. Stored as a unix timestamp at UTC. Can be null.

updated

Long

The timestamp in milliseconds indicating the last update of the work item. Stored as a unix timestamp at UTC. Can be null.

duration

DurationValue

The duration of the work item.

date

Long

The timestamp in milliseconds indicating the date and time of 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.

attributes

Array of WorkItemAttributes

The list of attributes of the work item. Read-only.

Read a Specific IssueWorkItem

Get a specific work item.

Required permissions

Requires access to the issue work item is added to and Read Work Item permission.

Request syntax

GET /api/workItems/{itemID}?{fields}

{itemID}

Database ID of the work item

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.youtrack.cloud/api/workItems/115-2?fields=created,duration(presentation,minutes),author(name),creator(name),date,id

Sample response body

{ "duration": { "minutes": 60, "presentation": "1h", "$type": "DurationValue" }, "date": 1538956800000, "created": 1539088817836, "creator": { "name": "John Doe", "$type": "User" }, "author": { "name": "Jane Doe", "$type": "User" }, "id": "115-2", "$type": "IssueWorkItem" }
Last modified: 23 April 2024