YouTrack Standalone 2018.3 Help

Project Time Tracking Settings

Resource

/api/admin/projects/<projectID>/timeTrackingSettings

Returned entity

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

Supported methods

Sub-resource

  • /api/admin/projects/<projectID>/timeTrackingSettings/workItemTypes
  • /api/admin/projects/<projectID>/timeTrackingSettings/workItemTypes/<workItemTypeID>

Supported Fields

This table describes attributes of the ProjectTimeTrackingSettings entity.

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

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

Field

Type

Description

enabled

Boolean

When true, time tracking in the project is enabled. Otherwise, time tracking is disabled in the project.

estimate

ProjectCustomField

A custom field that is used for estimation in the project. The field must be attached to the project.

project

Project

Entity that contains the project attributes.

timeSpent

ProjectCustomField

A custom field that is used for estimation in the project. The field must be attached to the project.

workItemTypes

WorkItemType

A collection of work item types that are used in the project.

id

String

Unique ID of the returned entity.

Read Time Tracking Settings of a Project

Request syntax

GET /api/admin/projects/<projectID>/timeTrackingSettings[?fields=<fields>]

Request parameters

Parameter

Type

Description

projectID

string

A unique ID of a project for which we request the time tracking settings.

fields

string

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

Sample request

curl -X GET \ 'https://example.myjetbrains.com/youtrack/api/admin/projects/0-0/timeTrackingSettings?fields=enabled,estimate%28field%28id,name%29,id%29,timeSpent%28field%28id,name%29,id%29,workItemTypes%28id,name,url%29' \ -H 'Accept: application/json' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json'

Sample response body

{ "enabled": false, "workItemTypes": [ { "name": "Development", "id": "65-0" }, { "name": "Testing", "id": "65-1" }, { "name": "Documentation", "id": "65-2" } ], "estimate": null, "timeSpent": null }

Update Time Tracking Settings of a Project

Request syntax

POST /api/admin/projects/<projectID>/timeTrackingSettings[?fields=<fields>]

Request parameters

Parameter

Type

Description

projectID

string

A unique ID of a project for which we request the time tracking settings.

fields

string

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

Sample request

curl -X POST \ 'https://example.myjetbrains.com/youtrack/api/admin/projects/0-0/timeTrackingSettings?fields=enabled,estimate%28field%28id,name%29,id%29,timeSpent%28field%28id,name%29,id%29,workItemTypes%28id,name,url%29' \ -H 'Accept: application/json' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json'

Sample response body

{ "enabled": false, "workItemTypes": [ { "name": "Development", "id": "65-0" }, { "name": "Testing", "id": "65-1" }, { "name": "Documentation", "id": "65-2" } ], "estimate": null, "timeSpent": null }

Types of Work Items in a Project

Manage work item types of the project.

Resource

/api/admin/projects/<projectID>/timeTrackingSettings/workItemTypes/<workItemTypeID>

Returned entity

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

Supported methods

Read Work Item Types in the Project

Get the list work item types that is used in a project with a specific ID.

Request syntax

GET /api/admin/projects/<projectID>/timeTrackingSettings[?fields=<fields>&$top&$skip]

Request parameters

Parameter

Type

Description

projectID

string

A unique ID of a project for which we request the time tracking settings.

fields

string

Optional. Lets you specify a subset of attributes to return for each ProjectTimeTrackingSettings entity in the response. If no fields specified, only the entity ID 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 request

curl -X GET \ 'https://example.myjetbrains.com/youtrack/api/admin/projects/0-0/timeTrackingSettings/workItemTypes?fields=id,name,url&$top=2' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json'

Sample response body

[ { "name": "Development", "id": "65-0" }, { "name": "Testing", "id": "65-1" } ]

Add a Work Item Type to the Project

Add an existing work item type to a project with a specific ID. To create a new work item type, use the System Time Tracking Settings.

Request syntax

POST /api/admin/projects/<projectID>/timeTrackingSettings[?fields=<fields>]

Request parameters

Parameter

Type

Description

projectID

string

A unique ID of a project for which we request the time tracking settings.

fields

string

Optional. Lets you specify a subset of attributes to return for each ProjectTimeTrackingSettings entity in the response. If no fields specified, only the entity ID is returned.

In the body of the request you must specify an entity ID of the type that you add to the project.

Sample request

curl -X POST \ 'https://example.myjetbrains.com/youtrack/api/admin/projects/0-0/timeTrackingSettings/workItemTypes?fields=id,name' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{"id" : "65-3"}'

Sample response body

{ "name": "Research", "id": "65-3" }

Operation with a Workitem Type

This resource lets you update and delete a specific work item type in a project.

Resource

/api/admin/projects/<projectID>/timeTrackingSettings/workItemTypes/<workItemTypeID>

Returned entity

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

Supported methods

To update a work item type, use the system time tracking settings resource.

Supported Fields

This table describes attributes of the WorkItemType entity.

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

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

Field

Type

Description

autoAttached

Boolean

When true, this work item type is automatically attached to all new projects with enabled time tracking.

name

String

A name of the work item type.

usages

ProjectTimeTrackingSettings

A mutable collection of ProjectTimeTrackingSettings that shows in time tracking settings instances this type is used. By a time tracking settings instance we mean an entity that stores time tracking configuration of a project.

id

String

Unique entity ID.

Read a Work Item Type in the Project

Get the list work item types that is used in a project with a specific ID.

Request syntax

GET /api/admin/projects/<projectID>/timeTrackingSettings/workItemTypes/<workItemTypeID>[?fields=<fields>]

Request parameters

Parameter

Type

Description

projectID

string

A unique ID of a project for which we request the time tracking settings.

workItemTypeID

string

A unique entity ID of a work item type, attributes of which you request to get.

fields

string

Optional. Lets you specify a subset of attributes to return for each ProjectTimeTrackingSettings entity in the response. If no fields specified, only the entity ID is returned.

Sample request

curl -X GET \ 'https://example.myjetbrains.com/youtrack/api/admin/projects/0-0/timeTrackingSettings/workItemTypes/65-0?fields=id,name&' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json'

Sample response body

{ "name": "Development", "id": "65-0" }

Detach a Work Item Type from the Project

Detach a work item type from a project with a specific ID.

Request syntax

DELETE /api/admin/projects/<projectID>/timeTrackingSettings/workItemTypes/<workItemTypeID>

Request parameters

Parameter

Type

Description

projectID

string

A unique ID of a project for which we request the time tracking settings.

workItemTypeID

string

A unique ID of a work itm type that you want to detach from the project.

Sample request

curl -X DELETE \ 'https://example.myjetbrains.com/youtrack/api/admin/projects/0-0/timeTrackingSettings/workItemTypes/65-3' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json'
Last modified: 12 October 2018