YouTrack Standalone 2019.2 Help

Project Custom Fields

This resource lets you access and configure custom fields in the specific project.

Resource

/api/admin/projects/{projectID}/customFields

Returned entity

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

Supported methods

ProjectCustomField attributes

Represents custom field settings for the particular project.

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

field

CustomField

Custom field which project settings are described. Read-only. Can be null.

project

Project

Project to which custom field belongs. Read-only. Can be null.

canBeEmpty

Boolean

If true, this field can have empty value in the issue, otherwise false.

emptyFieldText

String

Text that is shown as a placeholder when field is empty. Can be null.

ordinal

Int

Number of this field in project.

isPublic

Boolean

If true, issue public read/update are sufficient for accessing this field, otherwise private read/update are required.

hasRunningJob

Boolean

true, if there is a background job running for this field. In this case, some field operations may be temporary inaccessible. Read-only.

Read a List of ProjectCustomFields

Read the list of custom fields that are attached to a specific project.

Request syntax

GET /api/admin/projects/{projectID}/customFields?{fields}&{$top}&{$skip}

Request parameters

Parameter

Type

Description

fields

String

A list of ProjectCustomField 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 URI

https://example.myjetbrains.com/youtrack/api/admin/projects/0-0/fields?$top=5&fields=field(aliases,isAutoAttached,isUpdateable,name,id),canBeEmpty,isPublic,id

Sample response body

[ { "canBeEmpty": true, "isPublic": true, "field": { "isAutoAttached": true, "isUpdateable": true, "name": "Subsystem", "aliases": "in", "id": "58-0", "$type": "CustomField" }, "id": "92-0", "$type": "OwnedProjectCustomField" }, { "canBeEmpty": false, "isPublic": true, "field": { "isAutoAttached": true, "isUpdateable": true, "name": "Priority", "aliases": null, "id": "58-1", "$type": "CustomField" }, "id": "92-1", "$type": "EnumProjectCustomField" }, { "canBeEmpty": false, "isPublic": true, "field": { "isAutoAttached": true, "isUpdateable": true, "name": "Type", "aliases": null, "id": "58-2", "$type": "CustomField" }, "id": "92-2", "$type": "EnumProjectCustomField" }, { "canBeEmpty": false, "isPublic": true, "field": { "isAutoAttached": true, "isUpdateable": true, "name": "State", "aliases": null, "id": "58-3", "$type": "CustomField" }, "id": "92-3", "$type": "StateProjectCustomField" }, { "canBeEmpty": true, "isPublic": true, "field": { "isAutoAttached": true, "isUpdateable": true, "name": "Fix versions", "aliases": "fix for, fixed in, fix version, version", "id": "58-5", "$type": "CustomField" }, "id": "92-4", "$type": "VersionProjectCustomField" } ]

Add a New ProjectCustomField

Attach the custom field to the project. `field` and `$type` properties must be provided.

Request syntax

POST /api/admin/projects/{projectID}/customFields?{fields}

Request parameters

Parameter

Type

Description

fields

String

A list of ProjectCustomField 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/projects/0-0/fields

Sample request body

{ "field": { "aliases": null, "ordinal": 8, "localizedName": null, "instances": [], "usages": [], "isAutoAttached": false, "fieldDefaults": { "canBeEmpty": true, "emptyFieldText": null, "isPublic": true, "id": "72-1", "$type": "CustomFieldDefaults" }, "isUpdateable": true, "isDisplayedInIssueList": true, "fieldType": { "valueType": "date", "isMultiValue": false, "isBundleType": false, "canBeConvertedTo": [ { "localizedName": "\"date and time\"", "to": { "id": "date and time", "$type": "FieldType" }, "id": "DateToDateTimeConverter", "$type": "FieldConverter" } ], "id": "date", "$type": "FieldType" }, "hasRunningJob": false, "name": "Due Date", "id": "58-8", "$type": "CustomField" }, "$type": "SimpleProjectCustomField" }
Last modified: 22 October 2019