YouTrack Standalone 2020.2 Help

Operations with Specific CustomFieldDefaults

This resource lets you read and update default settings of a custom field in a project.

Resource

/api/admin/customFieldSettings/customFields/{fieldID}/fieldDefaults

Returned entity

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

Supported methods

CustomFieldDefaults attributes

Represents default project-related settings of the custom field. These settings are applied at the moment when the custom field is attached to a project. After that, any changes in default settings do not affect the field settings for this project.

This table describes attributes of the CustomFieldDefaults 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

canBeEmpty

Boolean

Indicates whether this field can have empty value in the issue.

emptyFieldText

String

The text that is shown as a placeholder when the field is empty. Can be null.

isPublic

Boolean

If `true`, then a user needs Read Issue and Update Issue permissions to access this field. Otherwise, the field is considered private, and Read Issue Private Fields and Update Issue Private Fields permissions are required.

parent

CustomField

Reference to the custom field. Read-only.

Read a Specific CustomFieldDefaults

Get default settings for the field.

Required permissions

Requires read access custom field.

Request syntax

GET /api/admin/customFieldSettings/customFields/{fieldID}/fieldDefaults?{fields}

Request parameters

Parameter

Type

Description

fields

String

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

Sample

Sample request URI

https://example.myjetbrains.com/youtrack/api/admin/customFieldSettings/customFields/58-8/fieldDefaults?fields=canBeEmpty,emptyFieldText,isPublic,parent(id,name)

Sample response body

{ "emptyFieldText": null, "canBeEmpty": true, "isPublic": true, "parent": { "name": "Due Date", "id": "58-8", "$type": "CustomField" }, "$type": "CustomFieldDefaults" }

Update a Specific CustomFieldDefaults

Update default settings for the field.

Required permissions

Requires Project Update permission in all the projects where field is used. If field is auto-attached, Low-level Admin Write permission is required.

Request syntax

POST /api/admin/customFieldSettings/customFields/{fieldID}/fieldDefaults?{fields}

Request parameters

Parameter

Type

Description

fields

String

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

Sample

Let's make the field private by default. Let's also set that it cannot be empty.

Sample request URI

https://example.myjetbrains.com/youtrack/api/admin/customFieldSettings/customFields/58-8/fieldDefaults?fields=canBeEmpty,emptyFieldText,isPublic,parent(id,name)

Sample request body

{ "emptyFieldText": null, "canBeEmpty": false, "isPublic": false }

Sample response body

{ "emptyFieldText": null, "canBeEmpty": false, "isPublic": false, "parent": { "isAutoAttached": false, "name": "Due Date", "id": "58-8", "$type": "CustomField" }, "$type": "CustomFieldDefaults" }
Last modified: 1 July 2020