YouTrack Standalone 2019.2 Help

Operations with Specific IssueCustomField

This resource lets you work with custom fields of the issue.

Resource

/api/issues/{issueID}/customFields/{fieldID}

Returned entity

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

Supported methods

IssueCustomField attributes

Represents the value of the custom field in the particular issue.

The IssueCustomField is an abstract ancestor for all types of custom fields in issues. The actual type of the custom field depends on settings of the particular project.

Each IssueCustomField entity, regardless of its type, has the following attributes:

  • projectCustomField: the reference to the settings of the custom field in the project.

  • value: the actual value assigned to the custom field in the issue. Depending on the type of the field, this attribute can store a single value or an array of values.

  • name: the string name of the custom field.

  • id: the entity ID of the issue custom field.

  • $type: the unique type of the issue custom field. You must provide this attribute when you update the custom field in an issue.

Because of the implementation specifics, the generated table for IssueCustomField attributes contains only the name attribute. See the description of the descendant entities for the supported attributes and their types.

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

name

String

The name of the custom field. Read-only.

Read a Specific IssueCustomField

Get a specific custom field in the issue.

Required permissions

For public field Read Issue permission is required. For private field Read Issue Private Fields is required.

Request syntax

GET /api/issues/{issueID}/customFields/{fieldID}?{fields}

{fieldID}

The entity ID of the target custom field in the issue.

Request parameters

Parameter

Type

Description

fields

String

A list of IssueCustomField 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/issues/2-7/fields/92-1?fields=id,name,value(id,name)

Sample response body

{ "value": { "name": "Major", "id": "67-2", "$type": "EnumBundleElement" }, "name": "Priority", "id": "92-1", "$type": "SingleEnumIssueCustomField" }

Update a Specific IssueCustomField

Update specific custom field in the issue.

To update a custom field in the issue, you must specify:

  1. The required value for the target custom field. You can identify the value by its name or entity ID.

  2. $type of the target issue custom field.

Required permissions

For public field: Create Issue permission is required for issue reporter and Update Issue permission otherwise.For private field: Update Issue Private Fields is required.

Request syntax

POST /api/issues/{issueID}/customFields/{fieldID}?{fields}

{fieldID}

The entity ID of the target custom field in the issue.

Request parameters

Parameter

Type

Description

fields

String

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

Sample

Let's change the Priority field of the issue, and set its value to Normal. To check that the request was successful, we instruct the server to return the field's value in the response body.

Sample request URI

https://example.myjetbrains.com/youtrack/api/issues/2-7/fields/92-1?fields=id,name,value(id,name)

Sample request body

{ "value": { "name": "Normal" } }

Sample response body

{ "value": { "name": "Normal", "id": "67-3", "$type": "EnumBundleElement" }, "name": "Priority", "id": "92-1", "$type": "SingleEnumIssueCustomField" }
Last modified: 17 December 2019