Developer Portal for YouTrack and Hub Help

Issue Activity Items

This resource lets you get the history of operations for a specific issue. It provides access to the issue activities with the possibility to filter them by various parameters.

Resource

/api/issues/{issueID}/activities

Returned entity

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

Supported methods

ActivityItem attributes

Represents a change in an issue or in its related entities. In the YouTrack UI, you see these changes in the activity stream. It shows a list of all changes related to this issue: the issue history, comments, attachments, VCS changes, work items, and so on.

Related Resources

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

Attributes

This table describes attributes of the ActivityItem 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 activity item. Read-only.

added

Single value or the list of values which were added to a property of the target entity. Read-only.

author

User

The user who performed the action. Read-only.

category

ActivityCategory

The category of the activity. Read-only.

field

FilterField

The filter field. It contains the additional information about the modified property in the target entity. For example, the information about a link type, or the type of the modified custom field or bundle, and so on. Read-only. Can be null.

removed

Single value or the list of values which were removed from a property of the target entity. Read-only.

target

The entity that is the target of the performed action. Read-only.

targetMember

String

The name of the property of the target entity, which was modified. Read-only. Can be null.

timestamp

Long

The timestamp of the activity event. Stored as a unix timestamp at UTC. Read-only.

Read a List of ActivityItems

Get a list of all activities in the specific issue.

Request syntax

GET /api/issues/{issueID}/activities?{fields}&{$top}&{$skip}&{categories}&{reverse}&{start}&{end}&{author}

Request parameters

Parameter

Type

Description

fields

String

A list of ActivityItem 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. If you don't set the $top value, the server limits the maximum number of returned entries.

The server returns a maximum of 42 entries for most resources that return collections. For more information, see Pagination.

categories

String

Mandatory. Parameter filters returned activities by categories. You must specify at least one category per request.

You can specify the categories query parameter in either of these formats:

  • categories=IssueCreatedCategory&categories=CommentsCategory
  • categories=IssueCreatedCategory,CommentsCategory

See this table for mapping between available categories and returned types of activity items.

reverse

Boolean

Indicates whether the order of returning activities is from newest to oldest or the opposite. If false, then the oldest activity item that matches a selected filter is returned first. If true, then the newest activity is returned first. By default, false.

start

String

The timestamp in milliseconds indicating the start of the time interval the activity timestamp belongs to. Stored as a unix timestamp at UTC. If the parameter is not set, it is considered to be 0.

end

String

The timestamp in milliseconds indicating the end of the time interval the activity timestamp belongs to. Stored as a unix timestamp at UTC. If the parameter is not set, it is considered as Long.MAX_VALUE.

author

String

Parameter to filter activities by the author. You can specify one of the following parameters: the database ID, login, Hub ID, or me for the currently logged in user.

Sample 1

This sample retrieves issue activity items of the following categories:

For each activity item, we request the item ID, the name and login of the author, the timestamp, and the target item.

Sample request

https://example.youtrack.cloud/api/issues/2-31/activities?fields=id,author(name,login),timestamp,target(id,text)&categories=CommentsCategory,IssueCreatedCategory,SummaryCategory,WorkItemCategory,ProjectCategory,IssueVisibilityCategory,AttachmentsCategory

Sample response body

[ { "id": "2-31.0-0", "target": { "id": "2-31", "$type": "Issue" }, "author": { "login": "john.doe", "name": "John Doe", "$type": "User" }, "timestamp": 1533139032010, "$type": "IssueCreatedActivityItem" }, { "id": "4-0.0-0", "author": { "login": "jane.doe", "name": "Jane Doe", "$type": "User" }, "timestamp": 1533214812208, "target": { "text": "@john.doe let's update the summary and description", "id": "4-0", "$type": "IssueComment" }, "$type": "CommentActivityItem" }, { "id": "4-2.0-0", "author": { "login": "john.doe", "name": "John Doe", "$type": "User" }, "timestamp": 1533221614364, "target": { "text": "okay, let's do it, @jane.doe. By the way, I'm updating this comment using REST.", "id": "4-2", "$type": "IssueComment" }, "$type": "CommentActivityItem" }, { "author": { "login": "john.doe", "name": "John Doe", "$type": "User" }, "timestamp": 1535649875680, "id": "0-0.9-60", "target": { "id": "2-31", "$type": "Issue" }, "$type": "SimpleValueActivityItem" }, { "author": { "login": "john.doe", "name": "John Doe", "$type": "User" }, "timestamp": 1535649875680, "id": "0-0.9-61", "target": { "id": "2-31", "$type": "Issue" }, "$type": "VisibilityGroupActivityItem" } ]

Sample 2

This sample retrieves issue activity items of the following categories:

For each activity item, we request the item ID, the name and login of the author, the timestamp, and the target item. We request activity items with timestamps within the range from January 1, 2022 to January 1, 2023.

Sample request

https://example.youtrack.cloud/api/issues/2-31/activities?fields=id,author(name,login),timestamp,target(id,text)&categories=CommentsCategory,WorkItemCategory&start=1640995200000&end=1672531200000

Sample response body

[ { "author": { "login": "minnie.terry", "name": "Minnie Terry", "$type": "User" }, "id": "136-268.0-0", "timestamp": 1654088791000, "target": { "text": "Any progress on that?", "id": "136-268", "$type": "IssueComment" }, "$type": "CommentActivityItem" }, { "author": { "login": "jane.doe", "name": "Jane Doe", "$type": "User" }, "id": "124-217.0-0", "timestamp": 1654175191000, "target": { "text": "initial implementation", "id": "124-217", "$type": "IssueWorkItem" }, "$type": "WorkItemActivityItem" }, { "author": { "login": "jane.doe", "name": "Jane Doe", "$type": "User" }, "id": "124-218.0-0", "timestamp": 1654261591000, "target": { "text": "updates", "id": "124-218", "$type": "IssueWorkItem" }, "$type": "WorkItemActivityItem" } ]
Last modified: 7 October 2024